Panel Interface Board  1
inszt_wl_cps.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:28:31 2020
5 */
6 /**************************************************************************************/
26 /**************************************************************************************/
27 /**************************************************************************************/
28 /* Section: Included Files */
29 /**************************************************************************************/
30 /**************************************************************************************/
31 #define QQQdialect MPLABX
32 #undef QQQ146
33 #undef QQQ148
34 #undef QQQbndchk
35 #undef QQQ294
36 #undef QQQEMBEDDEDICE
37  /* Note: for BITMAP execution histories QQQthreaded is not defined */
38 #undef QQQthreaded
39 #undef QQQdo178b
40 #undef QQQfixbra
41 #define QQQswitch3
42 #define QQQternary
43 #define QQQswitch
44 #undef QQQmacrof
45 #undef QQQMULTIPROCESSEXH
46 #undef QQFLUSH
47 #undef QQNEWBS
48 #define qqqMaxBranchDepth 20
49 #define QQQstructbitmap
50  static int qqqqbmselwidth = 32 ;
51  static int zzfileid = 51;
52 #define QQQnumfil 23
53 #undef QQQALGONE
54 #undef QQQVCLFLG
55 #undef QQQFORKFL
56 #undef QQQIADDRF
57 #undef QQQRTI
58 #undef QQQPERFA
59 #undef QQQADRMOD
60 #undef QQQDCAPFL
61 #undef QQQTEMPLATEONLY
62 #define QQQNOATEXIT
63 #define QQQUPLOADATEND
64 #define QQQNOSTDIO
65 #undef QQQASHLINGVITRA
66 #define QQQBITMAP
67  #define qqqbitmapint unsigned int
68 #undef QQQBITMAPMCDC
69 #undef QQQTIC2XSERIALIO
70 #undef QQQTIC2XFLASH
71 #undef QQQCOMPRESSED_EXH
72 #undef QQQMAINFL
73 #define QQQSINGLEFILE
74 #define QQQFILEID
75 #define QQQseparate
76 extern int QQQindicator;
77 static int QQQfirstmcdc=1;
78 #define wl_cps_51zzopen zzopen
79  extern int wl_cps_51zzopen ;
80 #define wl_cps_51zqqzqz1 zqqzqz1
81 #define QQQLDRA_PORT
82 #ifndef QQQLDRA_PORT
83 #define FILEPOINT FILE * f,
84 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
85 #include <stdio.h>
86  /* ----------------------------------------------------------------------* 100 *
87  * If stdio.h is not available then insert:
88  * typedef int * FILE;
89  * -----------------------------------------------------------------------------
90  */
91 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
92 #else /* QQQLDRA_PORT */
93 #define FILEPOINT
94 /*************************** LDRA_PORT *********************************/
95 #ifdef QQQ_SHLAYOUT
96 static int tbrun_mode=1;
97 #else
98 static int tbrun_mode=0;
99 #endif /* QQQ_SHLAYOUT */
100 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
101 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
102 #ifndef QQQ_SHLAYOUT
103 #ifdef QQQMAINFL
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
105 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
106 #endif /* QQQMAINFL */
107 #endif /* QQQ_SHLAYOUT */
108 /************************ END OF LDRA_PORT *****************************/
109 #endif /* QQQLDRA_PORT */
110 #ifndef QQQnumfil
111 #define QQQnumfil 40 /* default setting */
112 #endif /* QQQnumfil */
113 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
114 #ifndef LDRA_VOID_FUNC
115 #define LDRA_VOID_FUNC
116  typedef void(*ldra_void_function)();
117 #endif
118 #if defined(QQQMAINFL)
119  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
120  through the target you would have to set this to 0 before calling the qqqupload.
121  Move this into ldra_port mechanism. */
122  int qqqshell_upload = 0;
123  int QQQfcn_ptr_num = 0;
124  static int qqqisinitialised = 0;
127  void qqqtotalupload(void);
128  void qqqtotalreset(void);
130  qqqaccumupload[x]=y;
131  qqqaccumreset[x]=z;
132  QQQfcn_ptr_num++;
133  }
134 #else /* (QQQMAINFL) */
135  extern int QQQfcn_ptr_num;
138  static int qqqstructzzopen = 0;
139 #endif /* defined(QQQMAINFL) */
140 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
141 #ifdef QQQ_KEEPCOMMENTS
142  /* -----------------------------------------------------------------------* 101 *
143  * Special settings for systems lacking standard functions.
144  * To include code for fprintf define ldra_fprintf
145  * To include code for sscanf define ldra_sscanf
146  * -----------------------------------------------------------------------------
147  */
148 #endif /* QQQ_KEEPCOMMENTS */
149 #if !defined(QQQSUPPRESS_UNDEF)
150 #undef ldra_fprintf
151 #undef ldra_sscanf
152 #endif /* !defined(QQQSUPPRESS_UNDEF) */
153  /* #define ldra_fprintf */
154  /* #define ldra_sscanf */
155 #undef QQQHITMAP_STORAGE
156 #undef qqnull_params
157 #define qqnull_params void
158 #define QQQ_PROTOTYPE_DEF
159  /* Conventional Instrumentation */
160 #undef QQ_ANSI_PROTOTYPE
161 #ifdef __STDC__
162 #define QQ_ANSI_PROTOTYPE 1
163 #else /* __STDC__ */
164 #ifdef VAXC
165 #define QQ_ANSI_PROTOTYPE 1
166 #endif /* VAXC */
167 #endif /* __STDC__ */
168  static unsigned char qqqzzglobflag = 0;
169  static struct bitmapstruct_t
170  {
171 #define ELEMENT(N) qqqbitmapint element##N;
172 #define LASTELEMENT
173 #include "wl_cps_51zbelem.def"
174 #undef ELEMENT
175 #undef LASTELEMENT
176  } bitmapstruct = {
177 #define ELEMENT(N) 0,
178 #undef LASTELEMENT
179 #include "wl_cps_51zbelem.def"
180 #undef ELEMENT
181  0};
182  static void qqoutput(FILEPOINT char * s,int i);
183  static void qqoutput2(FILEPOINT char * s,int i, int j);
184  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
185  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
186  static void qqoutput0(FILEPOINT char * s);
187  static int wl_cps_51zqqzqz(qqnull_params);
188  static int wl_cps_51zqqzqz1(qqnull_params);
189  static int wl_cps_51zqendz (int qqqi);
190  static int wl_cps_51zqzqzq (int qqqi);
191  static void qqqupload(qqnull_params);
192  static void qqqbitmapreset(qqnull_params);
193 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
194 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h */
195 /**************************************************************************************/
210 /**************************************************************************************/
211 #ifndef WL_CPS_H /* Guard against multiple inclusion */
212 #define WL_CPS_H
213 /**************************************************************************************/
214 /* ************************************************************************************/
215 /* Section: Included Files */
216 /**************************************************************************************/
217 /**************************************************************************************/
218 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
219 /*******************************************************************************
220  System Definitions
221  File Name:
222  system_definitions.h
223  Summary:
224  MPLAB Harmony project system definitions.
225  Description:
226  This file contains the system-wide prototypes and definitions for an MPLAB
227  Harmony project.
228  *******************************************************************************/
229 //DOM-IGNORE-BEGIN
230 /*******************************************************************************
231 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
232 Microchip licenses to you the right to use, modify, copy and distribute
233 Software only when embedded on a Microchip microcontroller or digital signal
234 controller that is integrated into your product or third party product
235 (pursuant to the sublicense terms in the accompanying license agreement).
236 You should refer to the license agreement accompanying this Software for
237 additional information regarding your rights and obligations.
238 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
239 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
240 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
241 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
242 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
243 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
244 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
245 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
246 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
247 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
248  *******************************************************************************/
249 //DOM-IGNORE-END
250 #ifndef _SYS_DEFINITIONS_H
251 #define _SYS_DEFINITIONS_H
252 // *****************************************************************************
253 // *****************************************************************************
254 // Section: Included Files
255 // *****************************************************************************
256 // *****************************************************************************
257 #include <stdint.h>
258 #include <stddef.h>
259 #include <stdbool.h>
260 #include "system/common/sys_common.h"
261 #include "system/common/sys_module.h"
262 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
263 /*******************************************************************************
264  Input Capture Driver Interface Declarations for Static Single Instance Driver
265  Company:
266  Microchip Technology Inc.
267  File Name:
268  help_drv_ic.h
269  Summary:
270  Input Capture driver interface declarations for the static single instance
271  driver.
272  Description:
273  The Input Capture device driver provides a simple interface to manage the
274  Input Capture modules on Microchip microcontrollers. This file defines
275  the interface declarations for the IC driver.
276 
277  Remarks:
278  Static interfaces incorporate the driver instance number within the names
279  of the routines, eliminating the need for an object ID or object handle.
280 
281  Static single-open interfaces also eliminate the need for the open handle.
282 *******************************************************************************/
283 //DOM-IGNORE-BEGIN
284 /*******************************************************************************
285 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
286 Microchip licenses to you the right to use, modify, copy and distribute
287 Software only when embedded on a Microchip microcontroller or digital signal
288 controller that is integrated into your product or third party product
289 (pursuant to the sublicense terms in the accompanying license agreement).
290 You should refer to the license agreement accompanying this Software for
291 additional information regarding your rights and obligations.
292 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
293 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
294 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
295 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
296 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
297 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
298 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
299 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
300 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
301 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
302 *******************************************************************************/
303 //DOM-IGNORE-END
304 #ifndef _DRV_IC_H
305 #define _DRV_IC_H
306 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
307 /*******************************************************************************
308  MPLAB Harmony System Configuration Header
309  File Name:
310  system_config.h
311  Summary:
312  Build-time configuration header for the system defined by this MPLAB Harmony
313  project.
314  Description:
315  An MPLAB Project may have multiple configurations. This file defines the
316  build-time options for a single configuration.
317  Remarks:
318  This configuration header must not define any prototypes or data
319  definitions (or include any files that do). It only provides macro
320  definitions for build-time configuration options that are not instantiated
321  until used by another MPLAB Harmony module or application.
322  Created with MPLAB Harmony Version 2.06
323 *******************************************************************************/
324 // DOM-IGNORE-BEGIN
325 /*******************************************************************************
326 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
327 Microchip licenses to you the right to use, modify, copy and distribute
328 Software only when embedded on a Microchip microcontroller or digital signal
329 controller that is integrated into your product or third party product
330 (pursuant to the sublicense terms in the accompanying license agreement).
331 You should refer to the license agreement accompanying this Software for
332 additional information regarding your rights and obligations.
333 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
334 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
335 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
336 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
337 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
338 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
339 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
340 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
341 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
342 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
343 *******************************************************************************/
344 // DOM-IGNORE-END
345 #ifndef _SYSTEM_CONFIG_H
346 #define _SYSTEM_CONFIG_H
347 // *****************************************************************************
348 // *****************************************************************************
349 // Section: Included Files
350 // *****************************************************************************
351 // *****************************************************************************
352 /* This section Includes other configuration headers necessary to completely
353  define this configuration.
354 */
355 // DOM-IGNORE-BEGIN
356 // DOM-IGNORE-END
357 // *****************************************************************************
358 // *****************************************************************************
359 // Section: System Service Configuration
360 // *****************************************************************************
361 // *****************************************************************************
362 // *****************************************************************************
363 /* Common System Service Configuration Options
364 */
365 #define SYS_VERSION_STR "2.06"
366 #define SYS_VERSION 20600
367 // *****************************************************************************
368 /* Clock System Service Configuration Options
369 */
370 #define SYS_CLK_FREQ 200000000ul
371 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
372 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
373 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
374 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
375 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
376 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
377 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
378 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
379 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
380 /*** Ports System Service Configuration ***/
381 #define SYS_PORT_A_ANSEL 0x3F00
382 #define SYS_PORT_A_TRIS 0xFFED
383 #define SYS_PORT_A_LAT 0x0010
384 #define SYS_PORT_A_ODC 0x0000
385 #define SYS_PORT_A_CNPU 0x0020
386 #define SYS_PORT_A_CNPD 0x0000
387 #define SYS_PORT_A_CNEN 0x0021
388 #define SYS_PORT_B_ANSEL 0x10C8
389 #define SYS_PORT_B_TRIS 0x91FF
390 #define SYS_PORT_B_LAT 0x0000
391 #define SYS_PORT_B_ODC 0x0000
392 #define SYS_PORT_B_CNPU 0x0000
393 #define SYS_PORT_B_CNPD 0x0000
394 #define SYS_PORT_B_CNEN 0x0000
395 #define SYS_PORT_C_ANSEL 0xCFE1
396 #define SYS_PORT_C_TRIS 0xFFFF
397 #define SYS_PORT_C_LAT 0x0000
398 #define SYS_PORT_C_ODC 0x0000
399 #define SYS_PORT_C_CNPU 0x0000
400 #define SYS_PORT_C_CNPD 0x0000
401 #define SYS_PORT_C_CNEN 0x0000
402 #define SYS_PORT_D_ANSEL 0xC100
403 #define SYS_PORT_D_TRIS 0xFFFF
404 #define SYS_PORT_D_LAT 0x0000
405 #define SYS_PORT_D_ODC 0x0000
406 #define SYS_PORT_D_CNPU 0x0000
407 #define SYS_PORT_D_CNPD 0x0000
408 #define SYS_PORT_D_CNEN 0x0000
409 #define SYS_PORT_E_ANSEL 0xFC00
410 #define SYS_PORT_E_TRIS 0xFDFF
411 #define SYS_PORT_E_LAT 0x0000
412 #define SYS_PORT_E_ODC 0x0000
413 #define SYS_PORT_E_CNPU 0x0000
414 #define SYS_PORT_E_CNPD 0x0000
415 #define SYS_PORT_E_CNEN 0x0000
416 #define SYS_PORT_F_ANSEL 0xCEC0
417 #define SYS_PORT_F_TRIS 0xEFFF
418 #define SYS_PORT_F_LAT 0x0000
419 #define SYS_PORT_F_ODC 0x0000
420 #define SYS_PORT_F_CNPU 0x0000
421 #define SYS_PORT_F_CNPD 0x0000
422 #define SYS_PORT_F_CNEN 0x0000
423 #define SYS_PORT_G_ANSEL 0x8CBC
424 #define SYS_PORT_G_TRIS 0xDFFF
425 #define SYS_PORT_G_LAT 0x0000
426 #define SYS_PORT_G_ODC 0x0000
427 #define SYS_PORT_G_CNPU 0x0000
428 #define SYS_PORT_G_CNPD 0x0000
429 #define SYS_PORT_G_CNEN 0x0000
430 #define SYS_PORT_H_ANSEL 0x0070
431 #define SYS_PORT_H_TRIS 0xB3FB
432 #define SYS_PORT_H_LAT 0x0000
433 #define SYS_PORT_H_ODC 0x0000
434 #define SYS_PORT_H_CNPU 0x0000
435 #define SYS_PORT_H_CNPD 0x0000
436 #define SYS_PORT_H_CNEN 0x0000
437 #define SYS_PORT_J_ANSEL 0x0000
438 #define SYS_PORT_J_TRIS 0x8B7F
439 #define SYS_PORT_J_LAT 0x0080
440 #define SYS_PORT_J_ODC 0x0000
441 #define SYS_PORT_J_CNPU 0x0000
442 #define SYS_PORT_J_CNPD 0x0000
443 #define SYS_PORT_J_CNEN 0x0800
444 #define SYS_PORT_K_ANSEL 0xFF00
445 #define SYS_PORT_K_TRIS 0xFFFF
446 #define SYS_PORT_K_LAT 0x0000
447 #define SYS_PORT_K_ODC 0x0000
448 #define SYS_PORT_K_CNPU 0x0000
449 #define SYS_PORT_K_CNPD 0x0000
450 #define SYS_PORT_K_CNEN 0x0000
451 /*** Interrupt System Service Configuration ***/
452 #define SYS_INT true
453 /*** Timer System Service Configuration ***/
454 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
455 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
456 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
457 #define SYS_TMR_FREQUENCY 1000
458 #define SYS_TMR_FREQUENCY_TOLERANCE 10
459 #define SYS_TMR_UNIT_RESOLUTION 10000
460 #define SYS_TMR_CLIENT_TOLERANCE 10
461 #define SYS_TMR_INTERRUPT_NOTIFICATION false
462 // *****************************************************************************
463 // *****************************************************************************
464 // Section: Driver Configuration
465 // *****************************************************************************
466 // *****************************************************************************
467 #define DRV_IC_DRIVER_MODE_STATIC
468 #define USE_8BIT_PMP
469 /*** SPI Driver Configuration ***/
470 #define DRV_SPI_NUMBER_OF_MODULES 6
471 /*** Driver Compilation and static configuration options. ***/
472 /*** Select SPI compilation units.***/
473 #define DRV_SPI_POLLED 1
474 #define DRV_SPI_ISR 0
475 #define DRV_SPI_MASTER 1
476 #define DRV_SPI_SLAVE 0
477 #define DRV_SPI_RM 0
478 #define DRV_SPI_EBM 1
479 #define DRV_SPI_8BIT 1
480 #define DRV_SPI_16BIT 1
481 #define DRV_SPI_32BIT 0
482 #define DRV_SPI_DMA 0
483 /*** SPI Driver Static Allocation Options ***/
484 #define DRV_SPI_INSTANCES_NUMBER 3
485 #define DRV_SPI_CLIENTS_NUMBER 3
486 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
487 /* SPI Driver Instance 0 Configuration */
488 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
489 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
490 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
491 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
492 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
493 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
494 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
495 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
496 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
497 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
498 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
499 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
500 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
501 #define DRV_SPI_BAUD_RATE_IDX0 1000000
502 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
503 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
504 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
505 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
506 #define DRV_SPI_QUEUE_SIZE_IDX0 10
507 #define DRV_SPI_RESERVED_JOB_IDX0 1
508 /* SPI Driver Instance 1 Configuration */
509 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
510 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
511 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
512 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
513 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
514 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
515 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
516 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
517 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
518 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
519 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
520 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
521 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
522 #define DRV_SPI_BAUD_RATE_IDX1 1000000
523 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
524 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
525 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
526 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
527 #define DRV_SPI_QUEUE_SIZE_IDX1 10
528 #define DRV_SPI_RESERVED_JOB_IDX1 1
529 /* SPI Driver Instance 2 Configuration */
530 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
531 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
532 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
533 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
534 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
535 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
536 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
537 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
538 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
539 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
540 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
541 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
542 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
543 #define DRV_SPI_BAUD_RATE_IDX2 500000
544 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
545 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
546 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
547 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
548 #define DRV_SPI_QUEUE_SIZE_IDX2 10
549 #define DRV_SPI_RESERVED_JOB_IDX2 1
550 /*** Timer Driver Configuration ***/
551 #define DRV_TMR_INTERRUPT_MODE true
552 /*** Timer Driver 0 Configuration ***/
553 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
554 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
555 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
556 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
557 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
558 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
559 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
560 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
561 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
562 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
563 #define DRV_TMR_POWER_STATE_IDX0
564 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
565 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
566 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
567 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
568 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
569 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
570 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
571 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
572 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
573 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
574 #define DRV_TMR_POWER_STATE_IDX1
575 /*** Timer Driver 2 Configuration ***/
576 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
577 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
578 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
579 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
580 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
581 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
582 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
583 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
584 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
585 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
586 #define DRV_TMR_POWER_STATE_IDX2
587 /*** Timer Driver 3 Configuration ***/
588 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
589 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
590 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
591 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
592 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
593 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
594 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
595 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
596 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
597 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
598 #define DRV_TMR_POWER_STATE_IDX3
599 /*** Timer Driver 4 Configuration ***/
600 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
601 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
602 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
603 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
604 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
605 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
606 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
607 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
608 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
609 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
610 #define DRV_TMR_POWER_STATE_IDX4
611  // *****************************************************************************
612 /* USART Driver Configuration Options
613 */
614 #define DRV_USART_INSTANCES_NUMBER 1
615 #define DRV_USART_CLIENTS_NUMBER 1
616 #define DRV_USART_INTERRUPT_MODE false
617 #define DRV_USART_BYTE_MODEL_SUPPORT true
618 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
619 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
620 // *****************************************************************************
621 // *****************************************************************************
622 // Section: Middleware & Other Library Configuration
623 // *****************************************************************************
624 // *****************************************************************************
625 /*** USB Driver Configuration ***/
626 /* Enables Device Support */
627 #define DRV_USBHS_DEVICE_SUPPORT true
628 /* Disable Host Support */
629 #define DRV_USBHS_HOST_SUPPORT false
630 /* Maximum USB driver instances */
631 #define DRV_USBHS_INSTANCES_NUMBER 1
632 /* Interrupt mode enabled */
633 #define DRV_USBHS_INTERRUPT_MODE true
634 /* Number of Endpoints used */
635 #define DRV_USBHS_ENDPOINTS_NUMBER 2
636 /*** USB Device Stack Configuration ***/
637 /* The USB Device Layer will not initialize the USB Driver */
638 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
639 /* Maximum device layer instances */
640 #define USB_DEVICE_INSTANCES_NUMBER 1
641 /* EP0 size in bytes */
642 #define USB_DEVICE_EP0_BUFFER_SIZE 64
643 /* Endpoint Transfer Queue Size combined for Read and write */
644 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
645 // *****************************************************************************
646 // *****************************************************************************
647 // Section: Application Configuration
648 // *****************************************************************************
649 // *****************************************************************************
650 /*** Application Defined Pins ***/
651 /*** Functions for LED1 pin ***/
652 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
653 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
654 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
655 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
656 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
657 /*** Functions for LED2 pin ***/
658 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
659 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
660 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
661 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
662 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
663 /*** Functions for DMP_FIRE_LED pin ***/
664 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
665 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
666 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
667 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
668 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
669 /*** Functions for HVPS_ENB pin ***/
670 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
671 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
672 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
673 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
674 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
675 /*** Functions for RLY_HVPS_OUT pin ***/
676 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
677 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
678 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
679 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
680 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
681 /*** Functions for RLY_WL_SPS_POL pin ***/
682 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
683 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
684 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
685 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
686 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
687 /*** Functions for RLY_LOG pin ***/
688 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
689 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
690 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
691 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
692 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
693 /*** Functions for RLY_DMP_FIRE pin ***/
694 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
695 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
696 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
697 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
698 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
699 /*** Functions for RLY_AUX pin ***/
700 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
701 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
702 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
703 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
704 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
705 /*** Functions for RLY_CCL pin ***/
706 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
707 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
708 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
709 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
710 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
711 /*** Functions for RLY_WL_MON pin ***/
712 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
713 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
714 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
715 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
716 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
717 /*** Functions for RLY_ARMCF pin ***/
718 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
719 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
720 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
721 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
722 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
723 /*** Functions for RLY_ARM pin ***/
724 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
725 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
726 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
727 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
728 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
729 /*** Functions for TPAN1 pin ***/
730 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
731 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
732 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
733 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
734 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
735 /*** Functions for TPAN2 pin ***/
736 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
737 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
738 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
739 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
740 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
741 /*** Functions for FSK_DAC_CS pin ***/
742 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
743 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
744 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
745 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
746 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
747 /*** Functions for RLY_COMM pin ***/
748 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
749 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
750 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
751 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
752 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
753 /*** Functions for FSK_DAC_CLR pin ***/
754 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
755 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
756 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
757 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
758 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
759 /*** Functions for WL_CPS_SW pin ***/
760 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
761 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
762 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
763 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
764 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
765 /*** Functions for HVPS_SW pin ***/
766 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
767 /*** Functions for MAN_SIG pin ***/
768 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
769 /*** Functions for DMP_FIRE_SW pin ***/
770 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
771 /*** Functions for NEG_SW pin ***/
772 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
773 /*** Functions for POS_SW pin ***/
774 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
775 /*** Functions for DRUM1_SW pin ***/
776 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
777 /*** Functions for SAFE_SW pin ***/
778 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
779 /*** Functions for DRUM2_SW pin ***/
780 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
781 /*** Functions for LOG_SW pin ***/
782 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
783 /*** Functions for AUX_SW pin ***/
784 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
785 /*** Functions for ARMCF_SW pin ***/
786 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
787 /*** Functions for ARM_SW pin ***/
788 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
789 /*** Functions for ARMCF_AUTO_SW pin ***/
790 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
791 /*** Functions for FIRE_SW_OFF pin ***/
792 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
793 /*** Functions for FIRE_SW_ON pin ***/
794 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
795 /*** Functions for WL_SPS_POS_DET pin ***/
796 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
797 /*** Functions for WL_SPS_NEG_DET pin ***/
798 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
799 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
800 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
801 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
802 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
803 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
804 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
805 /*** Application Instance 0 Configuration ***/
806 //DOM-IGNORE-BEGIN
807 //DOM-IGNORE-END
808  // _SYSTEM_CONFIG_H
809 /*******************************************************************************
810  End of File
811 */
812 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
813 /* CLOSE_FILE Include File */
814 
815 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
816 /*******************************************************************************
817  Driver Common Header Definitions
818  Company:
819  Microchip Technology Inc.
820  File Name:
821  drv_common.h
822  Summary:
823  This file defines the common macros and definitions used by the driver
824  definition and implementation headers.
825  Description:
826  This file defines the common macros and definitions used by the driver
827  definition and the implementation header.
828  Remarks:
829  The directory in which this file resides should be added to the compiler's
830  search path for header files.
831  *******************************************************************************/
832 //DOM-IGNORE-BEGIN
833 /*******************************************************************************
834 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
835 Microchip licenses to you the right to use, modify, copy and distribute
836 Software only when embedded on a Microchip microcontroller or digital signal
837 controller that is integrated into your product or third party product
838 (pursuant to the sublicense terms in the accompanying license agreement).
839 You should refer to the license agreement accompanying this Software for
840 additional information regarding your rights and obligations.
841 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
842 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
843 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
844 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
845 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
846 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
847 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
848 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
849 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
850 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
851  *******************************************************************************/
852 //DOM-IGNORE-END
853 #ifndef _DRV_COMMON_H
854 #define _DRV_COMMON_H
855 #include <stdint.h>
856 #include <stddef.h>
857 // *****************************************************************************
858 /* Device Driver I/O Intent
859  Summary:
860  Identifies the intended usage of the device when it is opened.
861  Description:
862  This enumeration identifies the intended usage of the device when the
863  caller opens the device. It identifies the desired behavior of the device
864  driver for the following:
865  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
866  block until the operation is finished or do they return immediately and
867  require the caller to call another routine to check the status of the
868  operation)
869  * Support reading and/or writing of data from/to the device
870  * Identify the buffering behavior (sometimes called "double buffering" of
871  the driver. Indicates if the driver should maintain its own read/write
872  buffers and copy data to/from these buffers to/from the caller's buffers.
873  * Identify the DMA behavior of the peripheral
874  Remarks:
875  The buffer allocation method is not identified by this enumeration. Buffers
876  can be allocated statically at build time, dynamically at run-time, or
877  even allocated by the caller and passed to the driver for its own usage if
878  a driver-specific routine is provided for such. This choice is left to
879  the design of the individual driver and is considered part of its
880  interface.
881  These values can be considered "flags". One selection from each of the
882  groups below can be ORed together to create the complete value passed
883  to the driver's open routine.
884 */
885 
886 typedef
887  enum
888  {
889  /* Read */
890  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
891  = 1 << 0 /* DOM-IGNORE-END*/
892  ,
893  /* Write */
894  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
895  = 1 << 1 /* DOM-IGNORE-END*/
896  ,
897  /* Read and Write*/
898  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
899  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
900  ,
901  /* The driver will block and will return when the operation is complete */
902  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
903  = 0 << 2 /* DOM-IGNORE-END*/
904  ,
905  /* The driver will return immediately */
906  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
907  = 1 << 2 /* DOM-IGNORE-END*/
908  ,
909  /* The driver will support only one client at a time */
910  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
911  = 1 << 3 /* DOM-IGNORE-END*/
912  ,
913  /* The driver will support multiple clients at a time */
914  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
915  = 0 << 3 /* DOM-IGNORE-END*/
916  } DRV_IO_INTENT ;
917 // *****************************************************************************
918 /* Driver Client Status
919  Summary:
920  Identifies the current status/state of a client's connection to a driver.
921  Description:
922  This enumeration identifies the current status/state of a client's link to
923  a driver.
924  Remarks:
925  The enumeration used as the return type for the client-level status routines
926  defined by each device driver or system module (for example,
927  DRV_USART_ClientStatus) must be based on the values in this enumeration.
928 */
929 
930 typedef
931  enum
932  {
933  /* Indicates that a driver-specific error has occurred. */
935  /* An unspecified error has occurred.*/
937  /* The driver is closed, no operations for this client are ongoing,
938  and/or the given handle is invalid. */
940  /* The driver is currently busy and cannot start additional operations. */
942  /* The module is running and ready for additional operations */
944  /* Indicates that the module is in a driver-specific ready/run state. */
947 // *****************************************************************************
948 /* Device Driver Blocking Status Macro
949  Summary:
950  Returns if the I/O intent provided is blocking
951  Description:
952  This macro returns if the I/O intent provided is blocking.
953  Remarks:
954  None.
955 */
956 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
957 // *****************************************************************************
958 /* Device Driver Non Blocking Status Macro
959  Summary:
960  Returns if the I/O intent provided is non-blocking.
961  Description:
962  This macro returns if the I/ intent provided is non-blocking.
963  Remarks:
964  None.
965 */
966 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
967 // *****************************************************************************
968 /* Device Driver Exclusive Status Macro
969  Summary:
970  Returns if the I/O intent provided is non-blocking.
971  Description:
972  This macro returns if the I/O intent provided is non-blocking.
973  Remarks:
974  None.
975 */
976 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
977 // *****************************************************************************
978 /* Device Driver IO Buffer Identifier
979  Summary:
980  Identifies to which buffer a device operation will apply.
981  Description:
982  This enumeration identifies to which buffer (read, write, both, or neither)
983  a device operation will apply. This is used for "flush" (or similar)
984  operations.
985 */
986 
987 typedef
988  enum
989  {
990  // Operation does not apply to any buffer
992  // Operation applies to read buffer
994  // Operation applies to write buffer
996  // Operation applies to both read and write buffers
999 // *****************************************************************************
1000 /* Device Handle
1001  Summary:
1002  Handle to an opened device driver.
1003  Description:
1004  This handle identifies the open instance of a device driver. It must be
1005  passed to all other driver routines (except the initialization, deinitialization,
1006  or power routines) to identify the caller.
1007  Remarks:
1008  Every application or module that wants to use a driver must first call
1009  the driver's open routine. This is the only routine that is absolutely
1010  required for every driver.
1011  If a driver is unable to allow an additional module to use it, it must then
1012  return the special value DRV_HANDLE_INVALID. Callers should check the
1013  handle returned for this value to ensure this value was not returned before
1014  attempting to call any other driver routines using the handle.
1015 */
1016 
1017 typedef
1018 uintptr_t
1020 // *****************************************************************************
1021 /* Invalid Device Handle
1022  Summary:
1023  Invalid device handle.
1024  Description:
1025  If a driver is unable to allow an additional module to use it, it must then
1026  return the special value DRV_HANDLE_INVALID. Callers should check the
1027  handle returned for this value to ensure this value was not returned before
1028  attempting to call any other driver routines using the handle.
1029  Remarks:
1030  None.
1031 */
1032 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1033 // *****************************************************************************
1034 /* Not supported configuration
1035  Summary:
1036  Not supported configuration.
1037  Description:
1038  If the configuration option is not supported on an instance of the
1039  peripheral, use this macro to equate to that configuration. This option
1040  should be listed as a possible value in the description of that
1041  configuration option.
1042 */
1043 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1044 // *****************************************************************************
1045 /* Unsupported Attribute Abstraction
1046  Summary:
1047  Abstracts the use of the unsupported attribute defined by the compiler.
1048  Description:
1049  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1050  compilation of the drivers for all different variants.
1051  Example:
1052  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1053  This function will not generate a compiler error if the interface is not
1054  defined for the selected device.
1055  Remarks:
1056  None.
1057 */
1058 #define _PLIB_UNSUPPORTED
1059  //_DRV_COMMON_H
1060 /*******************************************************************************
1061  End of File
1062 */
1063 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1064 /* CLOSE_FILE Include File */
1065 
1066 #include "system/common/sys_module.h"
1067 // *****************************************************************************
1068 /* IC Driver Module Index Numbers
1069  Summary:
1070  IC driver index definitions.
1071  Description:
1072  These constants provide IC Driver index definitions.
1073  Remarks:
1074  These constants should be used in place of hard-coded numeric literals.
1075  These values should be passed into the DRV_IC_Initialize and
1076  DRV_IC_Open routines to identify the driver instance in use.
1077 */
1078 #define DRV_IC_INDEX_0 0
1079 #define DRV_IC_INDEX_1 1
1080 #define DRV_IC_INDEX_2 2
1081 #define DRV_IC_INDEX_3 3
1082 #define DRV_IC_INDEX_4 4
1083 #define DRV_IC_INDEX_5 5
1084 #define DRV_IC_INDEX_6 6
1085 #define DRV_IC_INDEX_7 7
1086 #define DRV_IC_INDEX_8 8
1087 #define DRV_IC_INDEX_9 9
1088 #define DRV_IC_INDEX_10 10
1089 #define DRV_IC_INDEX_11 11
1090 #define DRV_IC_INDEX_12 12
1091 #define DRV_IC_INDEX_13 13
1092 #define DRV_IC_INDEX_14 14
1093 #define DRV_IC_INDEX_15 15
1094 // *****************************************************************************
1095 // *****************************************************************************
1096 // Section: Interface Headers for the static driver
1097 // *****************************************************************************
1098 // *****************************************************************************
1099 // *****************************************************************************
1100 /* Function:
1101  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1102  const SYS_MODULE_INIT * const init);
1103  Summary:
1104  Initializes the Input Capture instance for the specified driver index.
1105  <p><b>Implementation:</b> Static</p>
1106  Description:
1107  This routine initializes the Input Capture driver instance for the specified
1108  driver instance, making it ready for clients to use it. The initialization
1109  routine is specified by the MHC parameters. The driver instance index is
1110  independent of the Input Capture module ID. For example, driver instance 0
1111  can be assigned to Input Capture 2.
1112  Precondition:
1113  None.
1114  Parameters:
1115  None.
1116  Returns:
1117  None.
1118  Remarks:
1119  This routine must be called before any other Input Capture routine is called.
1120  This routine should only be called once during system initialization.
1121 */
1122 
1123 SYS_MODULE_OBJ
1125  const SYS_MODULE_INDEX index ,
1126  const SYS_MODULE_INIT * const init ) ;
1127 // *****************************************************************************
1128 /* Function:
1129 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1130  Summary:
1131  Opens the Input Capture instance for the specified driver index.
1132  <p><b>Implementation:</b> Static</p>
1133  Description:
1134  This routine starts the Input Capture driver for the specified driver
1135  index, starting an input capture.
1136  Precondition:
1137  DRV_IC_Initialize has been called.
1138  Parameters:
1139  None.
1140  Returns:
1141  None.
1142  Remarks:
1143  None.
1144 */
1145 
1146 DRV_HANDLE
1147  DRV_IC_Open (
1148  const SYS_MODULE_INDEX drvIndex ,
1149  const DRV_IO_INTENT intent ) ;
1150 // *****************************************************************************
1151 /* Function:
1152  void DRV_IC_Close(DRV_HANDLE handle)
1153  Summary:
1154  Closes the Input Capture instance for the specified driver index.
1155  <p><b>Implementation:</b> Static</p>
1156  Description:
1157  This routine stops the Input Capture driver for the specified driver
1158  index, stopping an input capture.
1159  Precondition:
1160  DRV_IC_Initialize has been called.
1161  Parameters:
1162  None.
1163  Returns:
1164  None.
1165  Remarks:
1166  None.
1167 */
1168 
1169 void
1170  DRV_IC_Close (
1171  DRV_HANDLE handle ) ;
1172 // *****************************************************************************
1173 /* Function:
1174 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1175  Summary:
1176  Starts the Input Capture instance for the specified driver index.
1177  <p><b>Implementation:</b> Static</p>
1178  Description:
1179  This routine starts the Input Capture driver for the specified driver
1180  index, starting an input capture.
1181  Precondition:
1182  DRV_IC_Initialize has been called.
1183  Parameters:
1184  None.
1185  Returns:
1186  None.
1187  Remarks:
1188  None.
1189 */
1190 
1191 DRV_HANDLE
1192  DRV_IC_Start (
1193  const SYS_MODULE_INDEX drvIndex ,
1194  const DRV_IO_INTENT intent ) ;
1195 // *****************************************************************************
1196 /* Function:
1197  void DRV_IC_Stop(DRV_HANDLE handle)
1198  Summary:
1199  Stops the Input Capture instance for the specified driver index.
1200  <p><b>Implementation:</b> Static</p>
1201  Description:
1202  This routine stops the Input Capture driver for the specified driver
1203  index, stopping an input capture.
1204  Precondition:
1205  DRV_IC_Initialize has been called.
1206  Parameters:
1207  None.
1208  Returns:
1209  None.
1210  Remarks:
1211  None.
1212 */
1213 
1214 void
1215  DRV_IC_Stop (
1216  DRV_HANDLE handle ) ;
1217 // *****************************************************************************
1218 /* Function:
1219  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1220  Summary:
1221  Reads the 32-bit Input Capture for the specified driver index.
1222  <p><b>Implementation:</b> Static</p>
1223  Description:
1224  This routine reads the 32-bit data for the specified driver index
1225  Precondition:
1226  DRV_IC_Initialize has been called.
1227  Parameters:
1228  None.
1229  Returns:
1230  uint32_t value of the data read from the Input Capture.
1231  Remarks:
1232  None.
1233 */
1234 
1235 uint32_t
1237  DRV_HANDLE handle ) ;
1238 // *****************************************************************************
1239 /* Function:
1240  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1241  Summary:
1242  Reads the 16-bit Input Capture for the specified driver index.
1243  <p><b>Implementation:</b> Static</p>
1244  Description:
1245  This routine reads the 16-bit data for the specified driver index.
1246  Precondition:
1247  DRV_IC_Initialize has been called.
1248  Parameters:
1249  None.
1250  Returns:
1251  uint16_t value of the data read from the Input Capture.
1252  Remarks:
1253  None.
1254 */
1255 
1256 uint16_t
1258  DRV_HANDLE handle ) ;
1259 // *****************************************************************************
1260 /* Function:
1261  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1262  Summary:
1263  Returns the Input Capture instance buffer empty status for the specified driver
1264  index.
1265  <p><b>Implementation:</b> Static</p>
1266  Description:
1267  Returns the Input Capture instance buffer empty status for the specified driver
1268  index. The function should be called to determine whether or not the IC buffer
1269  has data.
1270  Precondition:
1271  DRV_IC_Initialize has been called.
1272  Parameters:
1273  None.
1274  Returns:
1275  Boolean
1276  - 1 - Buffer is empty
1277  - 0 - Buffer is not empty
1278  Remarks:
1279  None.
1280 */
1281 
1282 bool
1284  DRV_HANDLE handle ) ;
1285 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1286 /*******************************************************************************
1287  IC Driver Interface Declarations for Static Single Instance Driver
1288  Company:
1289  Microchip Technology Inc.
1290  File Name:
1291  drv_ic_static.h
1292  Summary:
1293  IC driver interface declarations for the static single instance driver.
1294  Description:
1295  The IC device driver provides a simple interface to manage the IC
1296  modules on Microchip microcontrollers. This file defines the interface
1297  Declarations for the IC driver.
1298 
1299  Remarks:
1300  Static interfaces incorporate the driver instance number within the names
1301  of the routines, eliminating the need for an object ID or object handle.
1302 
1303  Static single-open interfaces also eliminate the need for the open handle.
1304 *******************************************************************************/
1305 //DOM-IGNORE-BEGIN
1306 /*******************************************************************************
1307 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1308 Microchip licenses to you the right to use, modify, copy and distribute
1309 Software only when embedded on a Microchip microcontroller or digital signal
1310 controller that is integrated into your product or third party product
1311 (pursuant to the sublicense terms in the accompanying license agreement).
1312 You should refer to the license agreement accompanying this Software for
1313 additional information regarding your rights and obligations.
1314 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1315 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1316 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1317 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1318 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1319 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1320 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1321 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1322 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1323 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1324 *******************************************************************************/
1325 //DOM-IGNORE-END
1326 #ifndef _DRV_IC_STATIC_H
1327 #define _DRV_IC_STATIC_H
1328 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1329 #define DRV_IC_Close( handle )
1330 // *****************************************************************************
1331 // *****************************************************************************
1332 // Section: Interface Headers for Instance 0 for the static driver
1333 // *****************************************************************************
1334 // *****************************************************************************
1335 
1336 void
1337  DRV_IC0_Initialize ( void ) ;
1338 
1339 void
1340  DRV_IC0_Start ( void ) ;
1341 
1342 void
1343  DRV_IC0_Stop ( void ) ;
1344 
1345 uint32_t
1346  DRV_IC0_Capture32BitDataRead ( void ) ;
1347 
1348 uint16_t
1349  DRV_IC0_Capture16BitDataRead ( void ) ;
1350 
1351 bool
1352  DRV_IC0_BufferIsEmpty ( void ) ;
1353  // #ifndef _DRV_IC_STATIC_H
1354 /*******************************************************************************
1355  End of File
1356 */
1357 
1358 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1359 /* CLOSE_FILE Include File */
1360 
1361  // #ifndef _DRV_IC_H
1362 /*******************************************************************************
1363  End of File
1364 */
1365 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1366 /* CLOSE_FILE Include File */
1367 
1368 #include "system/devcon/sys_devcon.h"
1369 #include "system/clk/sys_clk.h"
1370 #include "system/int/sys_int.h"
1371 #include "system/tmr/sys_tmr.h"
1372 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1373 /*******************************************************************************
1374  ADC Driver Interface Declarations for Static Single Instance Driver
1375  Company:
1376  Microchip Technology Inc.
1377  File Name:
1378  drv_adc_static.h
1379  Summary:
1380  ADC driver interface declarations for the static single instance driver.
1381  Description:
1382  The ADC device driver provides a simple interface to manage the ADC
1383  modules on Microchip microcontrollers. This file defines the interface
1384  Declarations for the ADC driver.
1385 
1386  Remarks:
1387  Static interfaces incorporate the driver instance number within the names
1388  of the routines, eliminating the need for an object ID or object handle.
1389 
1390  Static single-open interfaces also eliminate the need for the open handle.
1391 *******************************************************************************/
1392 //DOM-IGNORE-BEGIN
1393 /*******************************************************************************
1394 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1395 Microchip licenses to you the right to use, modify, copy and distribute
1396 Software only when embedded on a Microchip microcontroller or digital signal
1397 controller that is integrated into your product or third party product
1398 (pursuant to the sublicense terms in the accompanying license agreement).
1399 You should refer to the license agreement accompanying this Software for
1400 additional information regarding your rights and obligations.
1401 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1402 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1403 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1404 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1405 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1406 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1407 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1408 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1409 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1410 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1411 *******************************************************************************/
1412 //DOM-IGNORE-END
1413 #ifndef _DRV_ADC_STATIC_H
1414 #define _DRV_ADC_STATIC_H
1415 #include <stdbool.h>
1416 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1417 #include "peripheral/adchs/plib_adchs.h"
1418 #include "peripheral/int/plib_int.h"
1419 
1420 typedef
1421  enum
1422  {
1423  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1425  } DRV_ADC_MODULE_ID ;
1426 // *****************************************************************************
1427 // *****************************************************************************
1428 // Section: Interface Headers for ADC Static Driver
1429 // *****************************************************************************
1430 // *****************************************************************************
1431 
1432 void
1433  DRV_ADC_Initialize ( void ) ;
1434 
1435 inline void
1436  DRV_ADC_DeInitialize ( void ) ;
1437 
1438 inline void
1439  DRV_ADC0_Open ( void ) ;
1440 
1441 inline void
1442  DRV_ADC0_Close ( void ) ;
1443 
1444 inline void
1445  DRV_ADC1_Open ( void ) ;
1446 
1447 inline void
1448  DRV_ADC1_Close ( void ) ;
1449 
1450 inline void
1451  DRV_ADC_Start ( void ) ;
1452 
1453 inline void
1454  DRV_ADC_Stop ( void ) ;
1455 
1456 uint32_t
1458  uint8_t bufIndex ) ;
1459 
1460 bool
1462  uint8_t bufIndex ) ;
1463  // #ifndef _DRV_ADC_STATIC_H
1464 /*******************************************************************************
1465  End of File
1466 */
1467 
1468 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1469 /* CLOSE_FILE Include File */
1470 
1471 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1472 /*******************************************************************************
1473  Timer Driver Interface Declarations for Static Single Instance Driver
1474  Company:
1475  Microchip Technology Inc.
1476  File Name:
1477  drv_tmr_static.h
1478  Summary:
1479  Timer driver interface declarations for the static single instance driver.
1480  Description:
1481  The Timer device driver provides a simple interface to manage the Timer
1482  modules on Microchip microcontrollers. This file defines the interface
1483  Declarations for the TMR driver.
1484 
1485  Remarks:
1486  Static interfaces incorporate the driver instance number within the names
1487  of the routines, eliminating the need for an object ID or object handle.
1488 
1489  Static single-open interfaces also eliminate the need for the open handle.
1490 *******************************************************************************/
1491 //DOM-IGNORE-BEGIN
1492 /*******************************************************************************
1493 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1494 Microchip licenses to you the right to use, modify, copy and distribute
1495 Software only when embedded on a Microchip microcontroller or digital signal
1496 controller that is integrated into your product or third party product
1497 (pursuant to the sublicense terms in the accompanying license agreement).
1498 You should refer to the license agreement accompanying this Software for
1499 additional information regarding your rights and obligations.
1500 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1501 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1502 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1503 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1504 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1505 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1506 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1507 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1508 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1509 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1510 *******************************************************************************/
1511 //DOM-IGNORE-END
1512 #ifndef _DRV_TMR_STATIC_H
1513 #define _DRV_TMR_STATIC_H
1514 // *****************************************************************************
1515 // *****************************************************************************
1516 // Section: Include Headers
1517 // *****************************************************************************
1518 // *****************************************************************************
1519 #include <stdint.h>
1520 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1521 /*******************************************************************************
1522  Timer Device Driver Interface Definition
1523  Company:
1524  Microchip Technology Inc.
1525  File Name:
1526  drv_tmr.h
1527  Summary:
1528  Timer device driver interface header file.
1529  Description:
1530  This header file contains the function prototypes and definitions of the
1531  data types and constants that make up the interface to the Timer device
1532  driver.
1533 *******************************************************************************/
1534 //DOM-IGNORE-BEGIN
1535 /*******************************************************************************
1536 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1537 Microchip licenses to you the right to use, modify, copy and distribute
1538 Software only when embedded on a Microchip microcontroller or digital signal
1539 controller that is integrated into your product or third party product
1540 (pursuant to the sublicense terms in the accompanying license agreement).
1541 You should refer to the license agreement accompanying this Software for
1542 additional information regarding your rights and obligations.
1543 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1544 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1545 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1546 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1547 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1548 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1549 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1550 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1551 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1552 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1553 *******************************************************************************/
1554 //DOM-IGNORE-END
1555 #ifndef _DRV_TMR_H
1556 #define _DRV_TMR_H
1557 // *****************************************************************************
1558 // *****************************************************************************
1559 // Section: File includes
1560 // *****************************************************************************
1561 // *****************************************************************************
1562 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1563 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1564 #include "peripheral/tmr/plib_tmr.h"
1565 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1566 /*******************************************************************************
1567  Timer Device Driver Interface Definition
1568  Company:
1569  Microchip Technology Inc.
1570  File Name:
1571  tmr_definitions_pic32m.h
1572  Summary:
1573  Timer device driver definitions header file.
1574  Description:
1575  This header file contains the definitions of the
1576  data types and constants that make up the interface to the Timer device
1577  driver.
1578 *******************************************************************************/
1579 //DOM-IGNORE-BEGIN
1580 /*******************************************************************************
1581 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1582 Microchip licenses to you the right to use, modify, copy and distribute
1583 Software only when embedded on a Microchip microcontroller or digital signal
1584 controller that is integrated into your product or third party product
1585 (pursuant to the sublicense terms in the accompanying license agreement).
1586 You should refer to the license agreement accompanying this Software for
1587 additional information regarding your rights and obligations.
1588 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1589 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1590 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1591 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1592 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1593 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1594 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1595 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1596 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1597 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1598 *******************************************************************************/
1599 //DOM-IGNORE-END
1600 #ifndef _TMR_DEFINITIONS_PIC32M_H
1601 #define _TMR_DEFINITIONS_PIC32M_H
1602 // DOM-IGNORE-BEGIN
1603 // DOM-IGNORE-END
1604 
1605 typedef
1606  enum
1607  {
1608  /* Clock input to the timer module is internal(Peripheral Clock) */
1610  /*DOM-IGNORE-BEGIN*/
1611  = 0x00 /*DOM-IGNORE-END*/
1612  ,
1613  /* Clock input to the timer module is from T1CK pin (external)
1614  with clock synchronization enabled */
1616  /*DOM-IGNORE-BEGIN*/
1617  = 0x01 /*DOM-IGNORE-END*/
1618  ,
1619  /* Clock input to the timer module is from T1CK pin (external)
1620  with clock synchronization disabled */
1622  /*DOM-IGNORE-BEGIN*/
1623  = 0x11 /*DOM-IGNORE-END*/
1624  ,
1625  /* Clock input to the timer module is from secondary oscillator (external)
1626  with clock synchronization enabled */
1628  /*DOM-IGNORE-BEGIN*/
1629  = 0x02 /*DOM-IGNORE-END*/
1630  ,
1631  /* Clock input to the timer module is from secondary oscillator (external)
1632  with clock synchronization disabled */
1634  /*DOM-IGNORE-BEGIN*/
1635  = 0x12 /*DOM-IGNORE-END*/
1636  ,
1637  /* Clock input to the timer module is from LPRC
1638  with clock synchronization enabled */
1640  /*DOM-IGNORE-BEGIN*/
1641  = 0x03 /*DOM-IGNORE-END*/
1642  ,
1643  /* Clock input to the timer module is from LPRC
1644  with clock synchronization disabled */
1646  /*DOM-IGNORE-BEGIN*/
1647  = 0x13 /*DOM-IGNORE-END*/
1649 //DOM-IGNORE-BEGIN
1650 //DOM-IGNORE-END
1651  // #ifndef _DRV_TMR_H
1652 /*******************************************************************************
1653  End of File
1654 */
1655 
1656 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1657 /* CLOSE_FILE Include File */
1658 
1659 #include "system/int/sys_int.h" // System Interrupt Definitions
1660 #include "system/clk/sys_clk.h"
1661 // DOM-IGNORE-BEGIN
1662 // DOM-IGNORE-END
1663 // *****************************************************************************
1664 // *****************************************************************************
1665 // Section: TMR Driver Data Types
1666 // *****************************************************************************
1667 // *****************************************************************************
1668 // *****************************************************************************
1669 /* Timer Driver Module Index Numbers
1670  Summary:
1671  Timer driver index definitions
1672  Description:
1673  These constants provide Timer driver index definitions.
1674  Remarks:
1675  These constants should be used in place of hard-coded numeric literals.
1676  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1677  functions to identify the driver instance in use.
1678 */
1679 #define DRV_TMR_INDEX_0 0
1680 #define DRV_TMR_INDEX_1 1
1681 #define DRV_TMR_INDEX_2 2
1682 #define DRV_TMR_INDEX_3 3
1683 #define DRV_TMR_INDEX_4 4
1684 #define DRV_TMR_INDEX_5 5
1685 #define DRV_TMR_INDEX_6 6
1686 #define DRV_TMR_INDEX_7 7
1687 #define DRV_TMR_INDEX_8 8
1688 #define DRV_TMR_INDEX_9 9
1689 #define DRV_TMR_INDEX_10 10
1690 #define DRV_TMR_INDEX_11 11
1691 // *****************************************************************************
1692 /* Timer Driver Module Index Count
1693  Summary:
1694  Number of valid Timer driver indices.
1695  Description:
1696  This constant identifies Timer driver index definitions.
1697  Remarks:
1698  This constant should be used in place of hard-coded numeric literals.
1699  This value is device-specific.
1700 */
1701 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1702 // *****************************************************************************
1703 /* Timer Driver Client Status
1704  Summary:
1705  Identifies the client-specific status of the Timer driver
1706  Description:
1707  This enumeration identifies the client-specific status of the Timer driver.
1708  Remarks:
1709  None.
1710 */
1711 
1712 typedef
1713  enum
1714  {
1715  /* Driver is invalid (or unopened) state */
1717  /*DOM-IGNORE-BEGIN*/
1718  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1719  ,
1720  /* An operation is currently in progress */
1722  /*DOM-IGNORE-BEGIN*/
1723  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1724  ,
1725  /* Ready, no operations running */
1727  /*DOM-IGNORE-BEGIN*/
1728  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1729  ,
1730  /* Timer started and running, processing transactions */
1732  /*DOM-IGNORE-BEGIN*/
1733  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1735 // *****************************************************************************
1736 /* Timer Driver Clock sources
1737  Summary:
1738  Lists the clock sources available for timer driver.
1739  Description:
1740  This enumeration lists all the available clock sources for the timer
1741  hardware.
1742  Remarks:
1743  Not all modes are available on all devices.
1744  'Synchronization' may not be applicable for all the instances of the timer.
1745  The driver discards the Synchronization mode selected if it is not
1746  applicable for the selected hardware.
1747 */
1748 // *****************************************************************************
1749 /* Timer Driver Operation mode
1750  Summary:
1751  Lists the operation modes available for timer driver.
1752  Description:
1753  This enumeration lists all the available operation modes that are valid for
1754  the timer hardware.
1755  Remarks:
1756  Not all modes are available on all devices.
1757 */
1758 
1759 typedef
1760  enum
1761  {
1762  /* The timer module operating mode none/invalid */
1764  /* The timer module operates in 16 bit mode */
1766  /* The timer module operates in 32 bit mode */
1767  /* This will combine two 16 bit timer modules */
1770 // *****************************************************************************
1771 /* Timer Driver divider operating specification
1772  Summary:
1773  This data structure specifies the divider values that can be obtained by the
1774  timer module.
1775  Description:
1776  This data structure specifies the divider values that can be obtained by the
1777  timer hardware.
1778  Remarks:
1779  None.
1780 */
1781 
1782 typedef
1783  struct
1784  {
1785  /* The minimum divider value that the timer module can obtain */
1786  uint32_t dividerMin ;
1787  /* The maximum divider value that the timer module can obtain */
1788  uint32_t dividerMax ;
1789  /* The divider step value, between 2 divider values */
1790  /* Should be 1 for most timers */
1791  uint32_t dividerStep ;
1793 // *****************************************************************************
1794 /* Timer Driver Initialize Data
1795  Summary:
1796  Defines the Timer driver initialization data.
1797  Description:
1798  This data type defines data required to initialize the Timer driver.
1799  Remarks:
1800  Not all initialization features are available on all devices.
1801 */
1802 
1803 typedef
1804  struct
1805  {
1806  /* System module initialization. */
1807  SYS_MODULE_INIT moduleInit ;
1808  /* Identifies timer hardware module (PLIB-level) ID */
1809  TMR_MODULE_ID tmrId ;
1810  /* Clock Source select. */
1811  DRV_TMR_CLK_SOURCES clockSource ;
1812  /* Prescaler Selection from the processor enumeration */
1813  TMR_PRESCALE prescale ;
1814  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1815  is selected the interrupt will be generated by the 2nd timer of the pair,
1816  the odd numbered one. */
1817  INT_SOURCE interruptSource ;
1818  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1819  timer modules to form a 32 bit one. This is usually only necessary for
1820  very long delays. */
1821  DRV_TMR_OPERATION_MODE mode ;
1822  /* Asynchronous write enable configuration. If true the asynchronous write
1823  is enabled. For timers that do not support this feature the value is
1824  ignored */
1825  bool asyncWriteEnable ;
1826  } DRV_TMR_INIT ;
1827 // *****************************************************************************
1828 /* Timer Driver Callback Function Pointer
1829  Summary:
1830  Pointer to a Timer driver callback function data type.
1831  Description:
1832  This data type defines a pointer to a Timer driver callback function.
1833  Remarks:
1834  Useful only when timer alarm callback support is enabled by defining the
1835  DRV_TMR_ALARM_ENABLE configuration option.
1836 */
1837 
1838 typedef
1839 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1840 uint32_t alarmCount ) ;
1841 // *****************************************************************************
1842 // *****************************************************************************
1843 // Section: Timer Driver Module Interface Functions
1844 // *****************************************************************************
1845 // *****************************************************************************
1846 // *****************************************************************************
1847 /* Function:
1848  SYS_MODULE_OBJ DRV_TMR_Initialize
1849  (
1850  const SYS_MODULE_INDEX drvIndex,
1851  const SYS_MODULE_INIT * const init
1852  )
1853  Summary:
1854  Initializes the Timer driver.
1855  <p><b>Implementation:</b> Static/Dynamic</p>
1856  Description:
1857  This function initializes the Timer driver, making it ready for clients to
1858  open and use it.
1859  Precondition:
1860  None.
1861  Parameters:
1862  drvIndex - Index for the driver instance to be initialized
1863  init - Pointer to a data structure containing any data necessary
1864  to initialize the driver.
1865  Returns:
1866  If successful, returns a valid handle to a driver object. Otherwise, it
1867  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1868  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1869  Example:
1870  <code>
1871  DRV_TMR_INIT init;
1872  SYS_MODULE_OBJ objectHandle;
1873  // Populate the timer initialization structure
1874  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1875  init.tmrId = TMR_ID_2;
1876  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1877  init.prescale = TMR_PRESCALE_VALUE_256;
1878  init.interruptSource = INT_SOURCE_TIMER_2;
1879  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1880  init.asyncWriteEnable = false;
1881  // Do something
1882  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1883  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1884  {
1885  // Handle error
1886  }
1887  </code>
1888  Remarks:
1889  This function must be called before any other Timer driver function is
1890  called.
1891  This function should only be called once during system initialization unless
1892  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1893  This function will NEVER block for hardware access. The system must use
1894  DRV_TMR_Status to find out when the driver is in the ready state.
1895  Build configuration options may be used to statically override options in
1896  the "init" structure and will take precedence over initialization data
1897  passed using this function.
1898 */
1899 
1900 SYS_MODULE_OBJ
1902  const SYS_MODULE_INDEX drvIndex ,
1903  const SYS_MODULE_INIT * const init ) ;
1904 // *****************************************************************************
1905 /* Function:
1906  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1907  Summary:
1908  Deinitializes the specified instance of the Timer driver.
1909  <p><b>Implementation:</b> Dynamic</p>
1910  Description:
1911  Deinitializes the specified instance of the Timer driver, disabling
1912  its operation (and any hardware). All internal data is invalidated.
1913  Precondition:
1914  The DRV_TMR_Initialize function must have been called before calling this
1915  function and a valid SYS_MODULE_OBJ must have been returned.
1916  Parameters:
1917  object - Driver object handle, returned from DRV_TMR_Initialize
1918  Returns:
1919  None.
1920  Example:
1921  <code>
1922  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1923  SYS_STATUS tmrStatus;
1924  DRV_TMR_Deinitialize ( tmrObject );
1925  tmrStatus = DRV_TMR_Status ( tmrObject );
1926  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1927  {
1928  // Check again later if you need to know
1929  // when the driver is deinitialized.
1930  }
1931  </code>
1932  Remarks:
1933  Once the Initialize operation has been called, the Deinitialize operation
1934  must be called before the Initialize operation can be called again.
1935  This function will NEVER block waiting for hardware. If the operation
1936  requires time to allow the hardware to complete, this will be reported by
1937  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1938  out when the module is in the ready state.
1939 */
1940 
1941 void
1943  SYS_MODULE_OBJ object ) ;
1944 // *****************************************************************************
1945 /* Function:
1946  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1947  Summary:
1948  Provides the current status of the Timer driver.
1949  <p><b>Implementation:</b> Dynamic</p>
1950  Description:
1951  This function provides the current status of the Timer driver.
1952  Precondition:
1953  The DRV_TMR_Initialize function must have been called before calling this
1954  function.
1955  Parameters:
1956  object - Driver object handle, returned from DRV_TMR_Initialize
1957  Returns:
1958  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1959  for operation
1960  Note: Any value greater than SYS_STATUS_READY is
1961  also a normal running state in which the driver
1962  is ready to accept new operations.
1963  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1964  Note: Any value less than SYS_STATUS_ERROR is
1965  also an error state.
1966  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1967  Note: This value is less than SYS_STATUS_ERROR.
1968  Example:
1969  <code>
1970  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1971  SYS_STATUS tmrStatus;
1972  tmrStatus = DRV_TMR_Status ( object );
1973  else if ( SYS_STATUS_ERROR >= tmrStatus )
1974  {
1975  // Handle error
1976  }
1977  </code>
1978  Remarks:
1979  The this operation can be used to determine when any of the driver's module
1980  level operations has completed.
1981  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1982  operation.
1983  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1984  also an error state.
1985  This function will NEVER block waiting for hardware.
1986 */
1987 
1988 SYS_STATUS
1989  DRV_TMR_Status (
1990  SYS_MODULE_OBJ object ) ;
1991 // *****************************************************************************
1992 /* Function:
1993  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1994  Summary:
1995  Maintains the driver's state machine.
1996  <p><b>Implementation:</b> Dynamic</p>
1997  Description:
1998  This function is used to maintain the driver's internal state machine and
1999  processes the timer events..
2000  Precondition:
2001  The DRV_TMR_Initialize function must have been called for the specified Timer
2002  driver instance.
2003  Parameters:
2004  object - Object handle for the specified driver instance (returned from
2005  DRV_TMR_Initialize)
2006  Returns:
2007  None
2008  Example:
2009  <code>
2010  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2011  while (true)
2012  {
2013  DRV_TMR_Tasks ( object );
2014  // Do other tasks
2015  }
2016  </code>
2017  Remarks:
2018  This function is normally not called directly by an application. It is
2019  called by the system's Tasks routine (SYS_Tasks)
2020 */
2021 
2022 void
2023  DRV_TMR_Tasks (
2024  SYS_MODULE_OBJ object ) ;
2025 // *****************************************************************************
2026 // *****************************************************************************
2027 // Section: TMR Driver Client Functions
2028 // *****************************************************************************
2029 // *****************************************************************************
2030 // *****************************************************************************
2031 /* Function:
2032  DRV_HANDLE DRV_TMR_Open
2033  (
2034  const SYS_MODULE_INDEX index,
2035  const DRV_IO_INTENT intent
2036  )
2037  Summary:
2038  Opens the specified Timer driver instance and returns a handle to it.
2039  <p><b>Implementation:</b> Dynamic</p>
2040  Description:
2041  This function opens the specified Timer driver instance and provides a
2042  handle that must be provided to all other client-level operations to
2043  identify the caller and the instance of the driver. Timer driver does not
2044  support multiple clients. If two tasks want to use the timer, one should
2045  wait until the other one gets closed.
2046  Precondition:
2047  The DRV_TMR_Initialize function must have been called before calling this
2048  function.
2049  Parameters:
2050  index - Identifier for the object instance to be opened
2051  intent - Zero or more of the values from the enumeration
2052  DRV_IO_INTENT ORed together to indicate the intended use
2053  of the driver
2054  Returns:
2055  If successful, the function returns a valid open instance handle (a number
2056  identifying both the caller and the module instance).
2057  If an error occurs, the return value is DRV_HANDLE_INVALID.
2058  Example:
2059  <code>
2060  DRV_HANDLE handle;
2061  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2062  if ( DRV_HANDLE_INVALID == handle )
2063  {
2064  // Unable to open the driver
2065  }
2066  </code>
2067  Remarks:
2068  The handle returned is valid until the DRV_TMR_Close function is called.
2069  This function will NEVER block waiting for hardware.
2070  If the requested intent flags are not supported, the function will return
2071  DRV_HANDLE_INVALID.
2072  The Timer driver does not support DRV_IO_INTENT_SHARED.
2073  Only exclusive access is supported for now.
2074 */
2075 
2076 DRV_HANDLE
2077  DRV_TMR_Open (
2078  const SYS_MODULE_INDEX index ,
2079  const DRV_IO_INTENT intent ) ;
2080 // *****************************************************************************
2081 /* Function:
2082  void DRV_TMR_Close ( DRV_HANDLE handle )
2083  Summary:
2084  Closes an opened instance of the Timer driver.
2085  <p><b>Implementation:</b> Dynamic</p>
2086  Description:
2087  This function closes an opened instance of the Timer driver, invalidating
2088  the handle.
2089  Precondition:
2090  The DRV_TMR_Initialize function must have been called for the specified
2091  Timer driver instance.
2092  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2093  Parameters:
2094  handle - A valid open-instance handle, returned from the driver's
2095  open routine
2096  Returns:
2097  None
2098  Example:
2099  <code>
2100  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2101  DRV_TMR_Close ( handle );
2102  </code>
2103  Remarks:
2104  After calling this function, the handle passed in "handle" must not be used
2105  with any of the remaining driver functions. A new handle must be obtained
2106  by calling DRV_TMR_Open before the caller may use the driver again.
2107  Note: Usually there is no need for the driver client to verify that the Close
2108  operation has completed.
2109 */
2110 
2111 void
2112  DRV_TMR_Close (
2113  DRV_HANDLE handle ) ;
2114 // *****************************************************************************
2115 /* Function:
2116  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2117  Summary:
2118  Gets the status of the client operation.
2119  <p><b>Implementation:</b> Dynamic</p>
2120  Description:
2121  This function gets the status of the recently completed client level
2122  operation.
2123  Precondition:
2124  The DRV_TMR_Initialize function must have been called for the specified
2125  Timer driver instance.
2126  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2127  Parameters:
2128  handle - A valid open-instance handle, returned from the driver's
2129  open routine
2130  Returns:
2131  None
2132  Example:
2133  <code>
2134  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2135  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2136  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2137  </code>
2138  Remarks:
2139  None.
2140 */
2141 
2144  DRV_HANDLE handle ) ;
2145 // *****************************************************************************
2146 // *****************************************************************************
2147 // Section: TMR Driver Counting functions
2148 // *****************************************************************************
2149 // *****************************************************************************
2150 // *****************************************************************************
2151 /* Function:
2152  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2153  Summary:
2154  Updates the Timer's counter register.
2155  <p><b>Implementation:</b> Static/Dynamic</p>
2156  Description:
2157  This function updates the Timer's value in the counter register.
2158  Precondition:
2159  The DRV_TMR_Initialize function must have been called.
2160  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2161  Parameters:
2162  handle - A valid open-instance handle, returned from the driver's
2163  open routine
2164  counterPeriod - counter period value
2165  - a 16 bit value if the timer is configured in 16 bit mode
2166  - a 32 bit value if the timer is configured in 32 bit mode
2167  Returns:
2168  None.
2169  Example:
2170  <code>
2171  </code>
2172  Remarks:
2173  None.
2174 */
2175 
2176 void
2178  DRV_HANDLE handle ,
2179  uint32_t counterPeriod ) ;
2180 // *****************************************************************************
2181 /* Function:
2182  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2183  Summary:
2184  Reads the Timer's counter register.
2185  <p><b>Implementation:</b> Static/Dynamic</p>
2186  Description:
2187  This function returns the Timer's value in the counter register.
2188  Precondition:
2189  The DRV_TMR_Initialize function must have been called.
2190  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2191  Parameters:
2192  handle - A valid open-instance handle, returned from the driver's
2193  open routine
2194  Returns:
2195  Timer current period:
2196  - a 16 bit value if the timer is configured in 16 bit mode
2197  - a 32 bit value if the timer is configured in 32 bit mode
2198  Example:
2199  <code>
2200  //Example to use timer for precision time measurement
2201  //without configuring an alarm (interrupt based)
2202  char appState = 0;
2203  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2204  switch ( appState )
2205  {
2206  case 0:
2207  //Calculate and set the counter period
2208  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2209  //counter starts
2210  DRV_TMR_Start ( tmrHandle );
2211  //Trigger an application operation
2212  app_trigger_operation();
2213  //Check for time-out in the next state
2214  appState++;
2215  case 1:
2216  //Overflows and stops at 0 if no alarm is set
2217  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2218  {
2219  //Time-out
2220  return false;
2221  }
2222  else if ( app_operation_isComplete( ) )
2223  {
2224  //Operation is complete before time-out
2225  return true;
2226  }
2227  </code>
2228  Remarks:
2229  None.
2230 */
2231 
2232 uint32_t
2234  DRV_HANDLE handle ) ;
2235 // *****************************************************************************
2236 /* Function:
2237  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2238  Summary:
2239  Clears the Timer's counter register.
2240  <p><b>Implementation:</b> Static/Dynamic</p>
2241  Description:
2242  This function clears the Timer's value in the counter register.
2243  Precondition:
2244  The DRV_TMR_Initialize function must have been called.
2245  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2246  Parameters:
2247  handle - A valid open-instance handle, returned from the driver's
2248  open routine
2249  Returns:
2250  None.
2251  Example:
2252  <code>
2253  </code>
2254  Remarks:
2255  None.
2256 */
2257 
2258 void
2260  DRV_HANDLE handle ) ;
2261 // *****************************************************************************
2262 /* Function:
2263  bool DRV_TMR_AlarmRegister
2264  (
2265  DRV_HANDLE handle,
2266  uint32_t divider,
2267  bool isPeriodic,
2268  uintptr_t context,
2269  DRV_TMR_CALLBACK callBack
2270  )
2271  Summary:
2272  Sets up an alarm.
2273  <p><b>Implementation:</b> Dynamic</p>
2274  Description:
2275  This function sets up an alarm, allowing the client to receive a callback
2276  from the driver when the timer counter reaches zero. Alarms can be one-shot
2277  or periodic. A periodic alarm will reload the timer and generate alarm
2278  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2279  divider;
2280  Precondition:
2281  The DRV_TMR_Initialize function must have been called.
2282  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2283  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2284  Parameters:
2285  handle - A valid handle, returned from DRV_TMR_Open
2286  divider - The value to divide the timer clock source to obtain the
2287  required alarm frequency.
2288  - a 16 bit value if the timer is configured in 16 bit mode
2289  - a 32 bit value if the timer is configured in 32 bit mode
2290  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2291  context - A reference, call back function will be called with the same
2292  reference.
2293  callBack - A call back function which will be called on time out.
2294  Returns:
2295  - true - if the call succeeded
2296  - false - the obtained divider could not be obtained or the passed handle was invalid
2297  Example:
2298  <code>
2299  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2300  void setupTask ()
2301  {
2302  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2303  uint32_t myFreq = 1000; // 1KHz
2304  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2305  // calculate the divider needed
2306  uint32_t divider = clkFreq / myFreq;
2307  // Start the alarm
2308  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2309  {
2310  // divider value could not be obtain;
2311  // handle the error
2312  //
2313  }
2314  }
2315  </code>
2316  Remarks:
2317  The divider value will be truncated to a 16 bit value if the timer is
2318  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2319  callback.
2320 */
2321 
2322 bool
2324  DRV_HANDLE handle ,
2325  uint32_t divider ,
2326  bool isPeriodic ,
2327  uintptr_t context ,
2328  DRV_TMR_CALLBACK callBack ) ;
2329 // *****************************************************************************
2330 /* Function:
2331  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2332  Summary:
2333  Disables an alarm signal.
2334  <p><b>Implementation:</b> Dynamic</p>
2335  Description:
2336  This function allows the client to disable an alarm generation.
2337  Use DRV_TMR_AlarmEnable to re-enable.
2338  Precondition:
2339  The DRV_TMR_Initialize function must have been called.
2340  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2341  A client alarm must be active.
2342  Parameters:
2343  handle - A valid handle, returned from DRV_TMR_Open
2344  Returns:
2345  The current status of the alarm:
2346  - true if the alarm was currently enabled
2347  - false if the alarm was currently disabled
2348  Example:
2349  <code>
2350  </code>
2351  Remarks:
2352  When the driver operates in interrupts this call resolves to a device
2353  interrupt disable.
2354  Do NOT disable the timer except for very short periods of time. If the time
2355  that the interrupt is disabled is longer than a wrap around period and the
2356  interrupt is missed, the hardware has no means of recovering and the
2357  resulting timing will be inaccurate.
2358 */
2359 
2360 bool
2362  DRV_HANDLE handle ) ;
2363 // *****************************************************************************
2364 /* Function:
2365  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2366  Summary:
2367  Re-enables an alarm signal.
2368  <p><b>Implementation:</b> Dynamic</p>
2369  Description:
2370  This function allows the client to re-enable an alarm after it has been
2371  disabled by a DRV_TMR_AlarmDisable call.
2372  Precondition:
2373  The DRV_TMR_Initialize function must have been called.
2374  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2375  Parameters:
2376  handle - A valid handle, returned from DRV_TMR_Open
2377  enable - boolean to enable the current callback
2378  Returns:
2379  None
2380  Example:
2381  <code>
2382  </code>
2383  Remarks:
2384  When the driver operates in interrupts this call resolves to a device
2385  interrupt re-enable.
2386 */
2387 
2388 void
2390  DRV_HANDLE handle ,
2391  bool enable ) ;
2392 // *****************************************************************************
2393 /* Function:
2394  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2395  Summary:
2396  Updates the Timer's period.
2397  <p><b>Implementation:</b> Dynamic</p>
2398  Description:
2399  This function updates the Timer's period.
2400  Precondition:
2401  The DRV_TMR_Initialize function must have been called.
2402  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2403  Parameters:
2404  handle - A valid open-instance handle, returned from the driver's
2405  open routine
2406  value - Period value
2407  - a 16 bit value if the timer is configured in 16 bit mode
2408  - a 32 bit value if the timer is configured in 32 bit mode
2409  Returns:
2410  None.
2411  Example:
2412  <code>
2413  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2414  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2415  </code>
2416  Remarks:
2417  - The period value will be truncated to a 16 bit value if the timer is
2418  configured in 16 bit mode.
2419 */
2420 
2421 void
2423  DRV_HANDLE handle ,
2424  uint32_t value ) ;
2425 // *****************************************************************************
2426 /* Function:
2427  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2428  Summary:
2429  Provides the Timer's period.
2430  <p><b>Implementation:</b> Dynamic</p>
2431  Description:
2432  This function gets the Timer's period.
2433  Precondition:
2434  The DRV_TMR_Initialize function must have been called.
2435  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2436  Parameters:
2437  handle - A valid open-instance handle, returned from the driver's
2438  open routine
2439  Returns:
2440  Timer period value:
2441  - a 16 bit value if the timer is configured in 16 bit mode
2442  - a 32 bit value if the timer is configured in 32 bit mode
2443  Example:
2444  <code>
2445  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2446  uint32_t period;
2447  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2448  </code>
2449  Remarks:
2450  None.
2451 */
2452 
2453 uint32_t
2455  DRV_HANDLE handle ) ;
2456 // *****************************************************************************
2457 /* Function:
2458  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2459  Summary:
2460  Removes a previously set alarm.
2461  <p><b>Implementation:</b> Dynamic</p>
2462  Description:
2463  This function removes a previously set alarm.
2464  Precondition:
2465  The DRV_TMR_Initialize function must have been called.
2466  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2467  DRV_TMR_AlarmRegister function must have been called before.
2468  Parameters:
2469  handle - A valid open-instance handle, returned from the driver's
2470  open routine
2471  Returns:
2472  None.
2473  Example:
2474  <code>
2475  // Example of a key debounce check
2476  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2477  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2478  void keyPressDetect ()
2479  {
2480  // Calculate the count to be passed on from the clock input
2481  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2482  }
2483  void DebounceCheck ( uintptr_t context )
2484  {
2485  readKey = AppReadKey();
2486  if ( readKey != lastReadKey )
2487  {
2488  lastReadKey = readKey;
2489  keyCount = 0;
2490  }
2491  else
2492  {
2493  if ( keyCount > 20 )
2494  {
2495  globalKeyState = readKey;
2496  DRV_TMR_AlarmDeregister ( tmrHandle );
2497  }
2498  keyCount++;
2499  }
2500  }
2501  </code>
2502  Remarks:
2503  None.
2504 */
2505 
2506 void
2508  DRV_HANDLE handle ) ;
2509 // *****************************************************************************
2510 // *****************************************************************************
2511 // Section: TMR Driver Operation Control Functions
2512 // *****************************************************************************
2513 // *****************************************************************************
2514 // *****************************************************************************
2515 /* Function:
2516  bool DRV_TMR_Start ( DRV_HANDLE handle )
2517  Summary:
2518  Starts the Timer counting.
2519  <p><b>Implementation:</b> Static/Dynamic</p>
2520  Description:
2521  This function starts the Timer counting.
2522  Precondition:
2523  The DRV_TMR_Initialize function must have been called.
2524  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2525  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2526  Parameters:
2527  handle - A valid open-instance handle, returned from the driver's
2528  open routine
2529  Returns:
2530  - true - if the operation succeeded
2531  - false - the supplied handle is invalid or the client doesn't have
2532  the needed parameters to run (alarm callback and period )
2533  Example:
2534  <code>
2535  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2536  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2537  DRV_TMR_Start ( tmrHandle );
2538  </code>
2539  Remarks:
2540  None.
2541 */
2542 
2543 bool
2544  DRV_TMR_Start (
2545  DRV_HANDLE handle ) ;
2546 // *****************************************************************************
2547 /* Function:
2548  void DRV_TMR_Stop ( DRV_HANDLE handle )
2549  Summary:
2550  Stops the Timer from counting.
2551  <p><b>Implementation:</b> Static/Dynamic</p>
2552  Description:
2553  This function stops the running Timer from counting.
2554  Precondition:
2555  The DRV_TMR_Initialize function must have been called.
2556  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2557  Parameters:
2558  handle - A valid open-instance handle, returned from the driver's
2559  open routine
2560  Returns:
2561  None.
2562  Example:
2563  <code>
2564  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2565  DRV_TMR_Stop ( handle );
2566  </code>
2567  Remarks:
2568  None.
2569 */
2570 
2571 void
2572  DRV_TMR_Stop (
2573  DRV_HANDLE handle ) ;
2574 // *****************************************************************************
2575 // *****************************************************************************
2576 // Section: TMR Driver Operation Status Functions
2577 // *****************************************************************************
2578 // *****************************************************************************
2579 // *****************************************************************************
2580 /* Function:
2581  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2582  Summary:
2583  Provides the status of Timer's period elapse.
2584  <p><b>Implementation:</b> Dynamic</p>
2585  Description:
2586  This function returns the number of times Timer's period has elapsed since
2587  last call to this API has made. On calling this API, the internally
2588  maintained counter will be cleared and count will be started again from next
2589  elapse.
2590  Precondition:
2591  The DRV_TMR_Initialize function must have been called.
2592  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2593  Parameters:
2594  handle - A valid handle, returned from the DRV_TMR_Open
2595  Returns:
2596  Number of times timer has elapsed since the last call.
2597  Example:
2598  <code>
2599  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2600  bool elapseStatus;
2601  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2602  unsigned int appInternalTime = 0;
2603  Sys_Tasks()
2604  {
2605  //Timer task will be called from ISR
2606  APP_TimeUpdate_Task();
2607  //Other Tasks
2608  }
2609  void APP_TimeUpdate_Task ( void )
2610  {
2611  //We will not miss a count even though we are late
2612  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2613  }
2614  </code>
2615  Remarks:
2616  None.
2617 */
2618 
2619 uint32_t
2621  DRV_HANDLE handle ) ;
2622 // *****************************************************************************
2623 // *****************************************************************************
2624 // Section: TMR Driver Control and Information Functions
2625 // *****************************************************************************
2626 // *****************************************************************************
2627 // *****************************************************************************
2628 /* Function:
2629  bool DRV_TMR_ClockSet
2630  (
2631  DRV_HANDLE handle,
2632  DRV_TMR_CLK_SOURCES clockSource,
2633  TMR_PRESCALE preScale
2634  )
2635  Summary:
2636  Sets the timers clock by selecting the source and prescaler.
2637  <p><b>Implementation:</b> Dynamic</p>
2638  Description:
2639  This function sets the timer clock by selecting the source and prescaler.
2640  The clock sources are device specific, refer device datasheet for supported
2641  clock sources. If unsupported clock source is passed then the behaviour of
2642  this function is unpredictable.
2643  Precondition:
2644  The DRV_TMR_Initialize function must have been called. Must have selected
2645  32-Bit timer mode if mode selection is applicable.
2646  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2647  Parameters:
2648  handle - A valid open-instance handle, returned from the driver's
2649  open routine
2650  clockSource - Clock source of the timer
2651  preScale - Timer's Prescaler divisor
2652  Returns:
2653  - true - if the operation is successful
2654  - false - either the handle is invalid or the clockSource
2655  and/or prescaler are not supported
2656  Example:
2657  <code>
2658  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2659  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2660  </code>
2661  Remarks:
2662  None.
2663 */
2664 
2665 bool
2667  DRV_HANDLE handle ,
2668  DRV_TMR_CLK_SOURCES clockSource ,
2669  TMR_PRESCALE preScale ) ;
2670 // *****************************************************************************
2671 /* Function:
2672  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2673  Summary:
2674  This function gets the currently selected prescaler.
2675  <p><b>Implementation:</b> Dynamic</p>
2676  Description:
2677  This function gets the currently selected prescaler.
2678  Precondition:
2679  The DRV_TMR_Initialize function must have been called.
2680  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2681  Parameters:
2682  handle - A valid open-instance handle, returned from the driver's
2683  open routine
2684  Returns:
2685  Timer prescaler.
2686  Example:
2687  <code>
2688  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2689  TMR_PRESCALE preScale;
2690  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2691  </code>
2692  Remarks:
2693  None.
2694 */
2695 
2696 TMR_PRESCALE
2698  DRV_HANDLE handle ) ;
2699 // *****************************************************************************
2700 /* Function:
2701  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2702  Summary:
2703  This function gets the currently selected operation mode.
2704  <p><b>Implementation:</b> Dynamic</p>
2705  Description:
2706  This function gets the currently selected 16/32 bit operation mode.
2707  Precondition:
2708  The DRV_TMR_Initialize function must have been called.
2709  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2710  Parameters:
2711  handle - A valid open-instance handle, returned from the driver's
2712  open routine
2713  Returns:
2714  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2715  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2716  handle.
2717  Example:
2718  <code>
2719  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2720  DRV_TMR_OPERATION_MODE operMode;
2721  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2722  </code>
2723  Remarks:
2724  None.
2725 */
2726 
2729  DRV_HANDLE handle ) ;
2730 // *****************************************************************************
2731 /* Function:
2732  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2733  Summary:
2734  Enables the Gate mode.
2735  <p><b>Implementation:</b> Dynamic</p>
2736  Description:
2737  This function enables the Gated mode of Timer. User can measure the duration
2738  of an external signal in this mode. Once the Gate mode is enabled, Timer
2739  will start on the raising edge of the external signal. It will keep counting
2740  until the next falling edge.
2741  Precondition:
2742  The DRV_TMR_Initialize function must have been called.
2743  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2744  Parameters:
2745  handle - A valid open-instance handle, returned from the driver's
2746  open routine
2747  Returns:
2748  - true - if the operation is successful
2749  - false - either the handle is invalid or the gate mode
2750  is not supported
2751  Example:
2752  <code>
2753  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2754  DRV_TMR_GateModeSet ( tmrHandle );
2755  </code>
2756  Remarks:
2757  None.
2758 */
2759 
2760 bool
2762  DRV_HANDLE handle ) ;
2763 // *****************************************************************************
2764 /* Function:
2765  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2766  Summary:
2767  Enables the Gate mode.
2768  <p><b>Implementation:</b> Dynamic</p>
2769  Description:
2770  This function enables the Gated mode of Timer. User can measure the duration
2771  of an external signal in this mode. Once the Gate mode is enabled, Timer
2772  will start on the raising edge of the external signal. It will keep counting
2773  until the next falling edge.
2774  Precondition:
2775  The DRV_TMR_Initialize function must have been called.
2776  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2777  Parameters:
2778  handle - A valid open-instance handle, returned from the driver's
2779  open routine
2780  Returns:
2781  - true - if the operation is successful
2782  - false - either the handle is invalid or the gate mode
2783  is not supported
2784  Example:
2785  <code>
2786  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2787  DRV_TMR_GateModeClear ( tmrHandle );
2788  </code>
2789  Remarks:
2790  None.
2791 */
2792 
2793 bool
2795  DRV_HANDLE handle ) ;
2796 // *****************************************************************************
2797 /* Function:
2798  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2799  Summary:
2800  Provides the Timer input frequency.
2801  <p><b>Implementation:</b> Dynamic</p>
2802  Description:
2803  This function provides the Timer input frequency. Input frequency is the
2804  clock to the Timer register and it is considering the prescaler divisor.
2805  Precondition:
2806  The DRV_TMR_Initialize function must have been called.
2807  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2808  Parameters:
2809  handle - A valid open-instance handle, returned from the driver's
2810  open routine
2811  Returns:
2812  32-bit value corresponding to the running frequency.
2813  If Timer clock source is external, then this function returns 0.
2814  Example:
2815  <code>
2816  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2817  uint32_t clkFreqHz;
2818  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2819  </code>
2820  Remarks:
2821  On most processors, the Timer's base frequency is the same as the peripheral
2822  bus clock.
2823 */
2824 
2825 uint32_t
2827  DRV_HANDLE handle ) ;
2828 // *****************************************************************************
2829 /* Function:
2830  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2831  (
2832  DRV_HANDLE handle,
2833  DRV_TMR_DIVIDER_RANGE* pDivRange
2834  )
2835  Summary:
2836  Returns the Timer divider values.
2837  <p><b>Implementation:</b> Dynamic</p>
2838  Description:
2839  This function provides the Timer operating mode and divider range.
2840  Precondition:
2841  The DRV_TMR_Initialize function must have been called.
2842  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2843  Parameters:
2844  handle - A valid open-instance handle, returned from the driver's
2845  open routine
2846  pDivRange - Address to store the timer divider range.
2847  Returns:
2848  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2849  The pDivRange is updated with the supported range values.
2850  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2851  Example:
2852  <code>
2853  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2854  DRV_TMR_OPERATION_MODE timerMode;
2855  DRV_TMR_DIVIDER_RANGE timerRange;
2856  DRV_TMR_DividerRangeGet(handle, &timerRange);
2857  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2858  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2859  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2860  </code>
2861  Remarks:
2862  None.
2863 */
2864 
2867  DRV_HANDLE handle ,
2868  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2869 // *****************************************************************************
2870 // *****************************************************************************
2871 // Section: File includes for the APIs which are required for backward
2872 // compatibility.
2873 // *****************************************************************************
2874 // *****************************************************************************
2875 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2876 /*******************************************************************************
2877  Timer Device Driver Interface Definition
2878  Company:
2879  Microchip Technology Inc.
2880  File Name:
2881  drv_tmr_compatibility.h
2882  Summary:
2883  Timer device driver interface header file.
2884  Description:
2885  This header file contains macro definition for APIs which will be deprecated
2886  later. This header file is included in drv_tmr.h.
2887 *******************************************************************************/
2888 //DOM-IGNORE-BEGIN
2889 /*******************************************************************************
2890 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2891 Microchip licenses to you the right to use, modify, copy and distribute
2892 Software only when embedded on a Microchip microcontroller or digital signal
2893 controller that is integrated into your product or third party product
2894 (pursuant to the sublicense terms in the accompanying license agreement).
2895 You should refer to the license agreement accompanying this Software for
2896 additional information regarding your rights and obligations.
2897 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2898 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2899 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2900 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2901 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2902 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2903 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2904 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2905 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2906 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2907 *******************************************************************************/
2908 //DOM-IGNORE-END
2909 #ifndef _DRV_TMR_DEPRECATED_H
2910 #define _DRV_TMR_DEPRECATED_H
2911 // *****************************************************************************
2912 // *****************************************************************************
2913 // Section: File includes
2914 // *****************************************************************************
2915 // *****************************************************************************
2916 // *****************************************************************************
2917 /* Function:
2918  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2919  Summary:
2920  Maintains the driver's state machine, processes the events and implements
2921  its ISR.
2922  <p><b>Implementation:</b> Dynamic</p>
2923  Description:
2924  This function is used to maintain the driver's internal state machine and
2925  processes the timer events in interrupt-driven implementations
2926  (DRV_TMR_INTERRUPT_MODE == true).
2927  Precondition:
2928  The DRV_TMR_Initialize function must have been called for the specified Timer
2929  driver instance.
2930  Parameters:
2931  object - Object handle for the specified driver instance (returned from
2932  DRV_TMR_Initialize)
2933  Returns:
2934  None
2935  Example:
2936  <code>
2937  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2938  {
2939  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2940  }
2941  </code>
2942  Remarks:
2943  This function is normally not called directly by an application.
2944  It is called by the timer driver raw ISR.
2945  This function will execute in an ISR context and will never block or access any
2946  resources that may cause it to block.
2947 
2948  This function will be deprecated later, so avoid using it as much as possible.
2949  Use generic function "DRV_TMR_Tasks" instead of this.
2950 */
2951 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2952 // *****************************************************************************
2953 /* Function:
2954  void DRV_TMR_CounterValue16BitSet
2955  (
2956  DRV_HANDLE handle,
2957  uint16_t counterPeriod
2958  )
2959  Summary:
2960  Updates the 16-bit Timer's counter register.
2961  <p><b>Implementation:</b> Dynamic</p>
2962  Description:
2963  This function updates the 16-bit Timer's value in the counter register. This
2964  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2965  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2966  DRV_TMR_CounterValue32BitSet function.
2967  Precondition:
2968  The DRV_TMR_Initialize function must have been called. Must have selected
2969  16-Bit timer mode if mode selection is applicable.
2970  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2971  Parameters:
2972  handle - A valid open-instance handle, returned from the driver's
2973  open routine
2974  counterPeriod - 16-bit counter period value
2975  Returns:
2976  None.
2977  Example:
2978  <code>
2979  //Example to use timer for precision time measurement
2980  //without configuring an alarm (interrupt based)
2981  char appState = 0;
2982  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2983 
2984  switch ( appState )
2985  {
2986  case 0:
2987  //Calculate and set the counter period
2988  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2989 
2990  //counter starts
2991  DRV_TMR_Start ( tmrHandle );
2992 
2993  //Trigger an application operation
2994  app_trigger_operation();
2995 
2996  //Check for time-out in the next state
2997  appState++;
2998  case 1:
2999  //Overflows and stops at 0 if no alarm is set
3000  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3001  {
3002  //Time-out
3003  return false;
3004  }
3005  else if ( app_operation_isComplete( ) )
3006  {
3007  //Operation is complete before time-out
3008  return true;
3009  }
3010  </code>
3011  Remarks:
3012  This function will be deprecated later, so avoid using it as much as possible.
3013  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3014 */
3015 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3016 // *****************************************************************************
3017 /* Function:
3018  void DRV_TMR_CounterValue32BitSet
3019  (
3020  DRV_HANDLE handle,
3021  uint32_t counterPeriod
3022  )
3023  Summary:
3024  Updates the 32-bit Timer's counter register.
3025  <p><b>Implementation:</b> Dynamic</p>
3026  Description:
3027  This function updates the 32-bit Timer's value in the counter register. This
3028  is valid only if the 32-bit mode of the timer is selected Otherwise use
3029  DRV_TMR_CounterValue16BitSet function.
3030  Precondition:
3031  The DRV_TMR_Initialize function must have been called. Must have selected
3032  32-Bit timer mode.
3033  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3034  Parameters:
3035  handle - A valid open-instance handle, returned from the driver's
3036  open routine
3037  counterPeriod - 32-bit counter period value
3038  Returns:
3039  None.
3040  Example:
3041  <code>
3042  //Example to use timer for precision time measurement
3043  //without configuring an alarm (interrupt based)
3044  char appState = 0;
3045  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3046 
3047  switch ( appState )
3048  {
3049  case 0:
3050  //Calculate and set the counter period
3051  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3052 
3053  //counter starts
3054  DRV_TMR_Start ( tmrHandle );
3055 
3056  //Trigger an application operation against which we want to use the time-out
3057  app_trigger_operation();
3058 
3059  //Check for time-out in the next state
3060  appState++;
3061  case 1:
3062  //Overflows and stops at 0 if no alarm is set
3063  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3064  {
3065  //Time-out
3066  return false;
3067  }
3068  else if ( app_operation_isComplete( ) )
3069  {
3070  //Operation is complete before time-out
3071  return true;
3072  }
3073  </code>
3074  Remarks:
3075  In most of the devices only even numbered instances of timer supports
3076  32-bit mode.
3077  This function will be deprecated later, so avoid using it as much as possible.
3078  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3079 */
3080 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3081 // *****************************************************************************
3082 /* Function:
3083  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3084  Summary:
3085  Reads the 16-bit Timer's counter register.
3086  <p><b>Implementation:</b> Dynamic</p>
3087  Description:
3088  This function returns the 16-bit Timer's value in the counter register. This
3089  is valid only if the 16-bit mode of the timer is selected.
3090  Otherwise use DRV_TMR_CounterValue32BitGet function.
3091  Precondition:
3092  The DRV_TMR_Initialize function must have been called. Must have selected
3093  16-Bit timer mode if mode selection is applicable.
3094  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3095  Parameters:
3096  handle - A valid open-instance handle, returned from the driver's
3097  open routine
3098 
3099  Returns:
3100  Timer period in 16-bit mode.
3101  Example:
3102  <code>
3103  //Example to use timer for precision time measurement
3104  //without configuring an alarm (interrupt based)
3105  char appState = 0;
3106  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3107 
3108  switch ( appState )
3109  {
3110  case 0:
3111  //Calculate and set the counter period
3112  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3113 
3114  //counter starts
3115  DRV_TMR_Start ( tmrHandle );
3116 
3117  //Trigger an application operation
3118  app_trigger_operation();
3119 
3120  //Check for time-out in the next state
3121  appState++;
3122  case 1:
3123  //Overflows and stops at 0 if no alarm is set
3124  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3125  {
3126  //Time-out
3127  return false;
3128  }
3129  else if ( app_operation_isComplete( ) )
3130  {
3131  //Operation is complete before time-out
3132  return true;
3133  }
3134  </code>
3135  Remarks:
3136  This function will be deprecated later, so avoid using it as much as possible.
3137  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3138 */
3139 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3140 // *****************************************************************************
3141 /* Function:
3142  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3143  Summary:
3144  Reads the 32-bit Timer's counter register.
3145  <p><b>Implementation:</b> Dynamic</p>
3146  Description:
3147  This function returns the 32-bit Timer's value in the counter register. This
3148  is valid only if the 32-bit mode of the timer is selected Otherwise use
3149  DRV_TMR_CounterValue16BitGet function.
3150  Precondition:
3151  The DRV_TMR_Initialize function must have been called. Must have selected
3152  32-Bit timer mode.
3153  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3154  Parameters:
3155  handle - A valid open-instance handle, returned from the driver's
3156  open routine
3157 
3158  Returns:
3159  32-Bit Counter value.
3160  Example:
3161  <code>
3162  //Example to use timer for precision time measurement
3163  //without configuring an alarm (interrupt based)
3164  char appState = 0;
3165  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3166 
3167  switch ( appState )
3168  {
3169  case 0:
3170  //Calculate and set the counter period
3171  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3172 
3173  //counter starts
3174  DRV_TMR_Start ( tmrHandle );
3175 
3176  //Trigger an application operation
3177  app_trigger_operation();
3178 
3179  //Check for time-out in the next state
3180  appState++;
3181  case 1:
3182  //Overflows and stops at 0 if no alarm is set
3183  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3184  {
3185  //Time-out
3186  return false;
3187  }
3188  else if ( app_operation_isComplete( ) )
3189  {
3190  //Operation is complete before time-out
3191  return true;
3192  }
3193  </code>
3194  Remarks:
3195  In most of the devices only even numbered instances of timer supports
3196  32-bit mode.
3197  This function will be deprecated later, so avoid using it as much as possible.
3198  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3199 */
3200 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3201 // *****************************************************************************
3202 /* Function:
3203  void DRV_TMR_Alarm16BitRegister
3204  (
3205  DRV_HANDLE handle,
3206  uint16_t period,
3207  bool isPeriodic,
3208  uintptr_t context,
3209  DRV_TMR_CALLBACK callBack
3210  )
3211  Summary:
3212  Sets up an alarm.
3213  <p><b>Implementation:</b> Dynamic</p>
3214  Description:
3215  This function sets up an alarm, allowing the client to receive a callback
3216  from the driver when the counter period elapses. Alarms can be one-shot or
3217  periodic. This API is valid only if the 16-bit mode of the timer is
3218  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3219  Precondition:
3220  The DRV_TMR_Initialize function must have been called. Must have selected
3221  16-Bit timer mode if mode selection is applicable.
3222  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3223  Parameters:
3224  handle - A valid handle, returned from DRV_TMR_Open
3225  period - 16-bit period which will be loaded into the Timer hardware register.
3226 
3227  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3228 
3229  context - A reference, call back function will be called with the same
3230  reference.
3231 
3232  callBack - A call back function which will be called on period elapse.
3233 
3234  Returns:
3235  None
3236  Example:
3237  <code>
3238  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3239 
3240  void setupTask ()
3241  {
3242  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3243 
3244  // Calculate the count to be passed on from the clock input
3245  //Periodically toggle LED
3246  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3247  ToggleLedCallBack );
3248  }
3249 
3250  void ToggleLedCallBack ( uintptr_t context )
3251  {
3252  //Toggle
3253  }
3254  </code>
3255  Remarks:
3256  This function will be deprecated later, so avoid using it as much as possible.
3257  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3258 */
3259 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3260 // *****************************************************************************
3261 /* Function:
3262  void DRV_TMR_Alarm32BitRegister
3263  (
3264  DRV_HANDLE handle,
3265  uint32_t period,
3266  bool isPeriodic,
3267  uintptr_t context,
3268  DRV_TMR_CALLBACK callBack
3269  )
3270  Summary:
3271  Sets up an alarm.
3272  <p><b>Implementation:</b> Dynamic</p>
3273  Description:
3274  This function sets up an alarm, allowing the client to receive a callback
3275  from the driver when the counter period elapses. Alarms can be one-shot or
3276  periodic. This API is valid only if the 32-bit mode of the timer is
3277  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3278  Precondition:
3279  The DRV_TMR_Initialize function must have been called. Must have selected
3280  32-Bit timer mode.
3281  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3282  Parameters:
3283  handle - A valid handle, returned from DRV_TMR_Open
3284  period - 32-bit period which will be loaded into the Timer hardware register.
3285 
3286  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3287 
3288  context - A reference, call back function will be called with the same
3289  reference.
3290 
3291  callBack - A call back function which will be called on period elapse.
3292 
3293  Returns:
3294  None
3295  Example:
3296  <code>
3297  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3298 
3299  void setupTask ()
3300  {
3301  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3302 
3303  // Calculate the count to be passed on from the clock input
3304  //Periodically toggle LED
3305  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3306  ToggleLedCallBack );
3307  }
3308 
3309  void ToggleLedCallBack ( uintptr_t context )
3310  {
3311  //Toggle
3312  }
3313  </code>
3314  Remarks:
3315  In most of the devices only even numbered instances of timer supports
3316  32-bit mode.
3317  This function will be deprecated later, so avoid using it as much as possible.
3318  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3319 */
3320 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3321 // *****************************************************************************
3322 /* Function:
3323  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3324  Summary:
3325  Updates the 16-bit Timer's period.
3326  <p><b>Implementation:</b> Dynamic</p>
3327  Description:
3328  This function updates the 16-bit Timer's period. This API is valid only if
3329  the 16-bit mode of the timer is selected
3330  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3331  Precondition:
3332  The DRV_TMR_Initialize function must have been called. Must have selected
3333  16-Bit timer mode if mode selection is applicable.
3334  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3335  Parameters:
3336  handle - A valid open-instance handle, returned from the driver's
3337  open routine
3338  value - 16-bit Period value
3339  Returns:
3340  None.
3341  Example:
3342  <code>
3343  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3344  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3345  </code>
3346  Remarks:
3347  This function will be deprecated later, so avoid using it as much as possible.
3348  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3349 */
3350 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3351 // *****************************************************************************
3352 /* Function:
3353  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3354  Summary:
3355  Updates the 32-bit Timer's period.
3356  <p><b>Implementation:</b> Dynamic</p>
3357  Description:
3358  This function updates the 32-bit Timer's period. This API is valid only if
3359  the 32-bit mode of the timer is selected
3360  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3361  Precondition:
3362  The DRV_TMR_Initialize unction must have been called. Must have selected
3363  32-Bit timer mode.
3364  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3365  Parameters:
3366  handle - A valid open-instance handle, returned from the driver's
3367  open routine
3368  period - 32-bit Period value
3369  Returns:
3370  None.
3371  Example:
3372  <code>
3373  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3374  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3375  </code>
3376  Remarks:
3377  In most of the devices only even numbered instances of timer supports
3378  32-bit mode.
3379  This function will be deprecated later, so avoid using it as much as possible.
3380  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3381 */
3382 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3383 // *****************************************************************************
3384 /* Function:
3385  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3386  Summary:
3387  Provides the 16-bit Timer's period.
3388  <p><b>Implementation:</b> Dynamic</p>
3389  Description:
3390  This function gets the 16-bit Timer's period. This API is valid only if
3391  the 16-bit mode of the timer is selected.
3392  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3393  Precondition:
3394  The DRV_TMR_Initialize function must have been called. Must have selected
3395  16-Bit timer mode if mode selection is applicable.
3396  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3397  Parameters:
3398  handle - A valid open-instance handle, returned from the driver's
3399  open routine
3400  Returns:
3401  16-bit timer period value
3402  Example:
3403  <code>
3404  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3405  uint16_t period;
3406 
3407  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3408  </code>
3409  Remarks:
3410  This function will be deprecated later, so avoid using it as much as possible.
3411  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3412 */
3413 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3414 // *****************************************************************************
3415 /* Function:
3416  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3417  Summary:
3418  Provides the 32-bit Timer's period.
3419  <p><b>Implementation:</b> Dynamic</p>
3420  Description:
3421  This function gets the 32-bit Timer's period. This API is valid only if
3422  the 32-bit mode of the timer is selected
3423  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3424  Precondition:
3425  The DRV_TMR_Initialize function must have been called. Must have selected
3426  32-Bit timer mode.
3427  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3428  Parameters:
3429  handle - A valid open-instance handle, returned from the driver's
3430  open routine
3431  Returns:
3432  32-bit Timer period value.
3433  Example:
3434  <code>
3435  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3436  uint32_t period;
3437  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3438  </code>
3439  Remarks:
3440  In most of the devices only even numbered instances of timer supports
3441  32-bit mode.
3442  This function will be deprecated later, so avoid using it as much as possible.
3443  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3444 */
3445 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3446 // *****************************************************************************
3447 /* Function:
3448  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3449  Summary:
3450  Removes a previously set alarm.
3451  <p><b>Implementation:</b> Dynamic</p>
3452  Description:
3453  This function removes a previously set alarm. This API is valid only if
3454  the 16-bit mode of the timer is selected
3455  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3456  Precondition:
3457  The DRV_TMR_Initialize function must have been called. Must have selected
3458  16-Bit timer mode if mode selection is applicable.
3459  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3460 
3461  DRV_TMR_Alarm16BitRegister function must have been called before.
3462  Parameters:
3463  handle - A valid open-instance handle, returned from the driver's
3464  open routine
3465  Returns:
3466  None.
3467  Example:
3468  <code>
3469  //Example of a key debounce check
3470 
3471  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3472  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3473  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3474 
3475  void keyPressDetect ()
3476  {
3477  // Calculate the count to be passed on from the clock input
3478  //Periodically toggle LED
3479  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3480  DebounceCheck );
3481  }
3482 
3483  void DebounceCheck ( uintptr_t context )
3484  {
3485  readKey = AppReadKey();
3486 
3487  if ( readKey != lastReadKey )
3488  {
3489  lastReadKey = readKey;
3490  keyCount = 0;
3491  }
3492  else
3493  {
3494  if ( keyCount > 20 )
3495  {
3496  globalKeyState = readKey;
3497  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3498  }
3499  keyCount++;
3500  }
3501  }
3502  </code>
3503  Remarks:
3504  This function will be deprecated later, so avoid using it as much as possible.
3505  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3506 */
3507 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3508 // *****************************************************************************
3509 /* Function:
3510  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3511  Summary:
3512  Removes a previously set alarm.
3513  <p><b>Implementation:</b> Dynamic</p>
3514  Description:
3515  This function removes a previously set alarm. This API is valid only if
3516  the 32-bit mode of the timer is selected
3517  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3518  Precondition:
3519  The DRV_TMR_Initialize function must have been called. Must have selected
3520  32-Bit timer mode if mode selection is applicable.
3521  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3522 
3523  DRV_TMR_Alarm32BitRegister function must have been called before.
3524  Parameters:
3525  handle - A valid open-instance handle, returned from the driver's
3526  open routine
3527  Returns:
3528  None.
3529  Example:
3530  <code>
3531  //Example of a key debounce check
3532 
3533  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3534  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3535  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3536 
3537  void keyPressDetect ( void )
3538  {
3539  // Calculate the count to be passed on from the clock input
3540  //Periodically check the key status
3541  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3542  DebounceCheck );
3543  }
3544 
3545  void DebounceCheck ( uintptr_t context )
3546  {
3547  readKey = AppReadKey();
3548 
3549  if ( readKey != lastReadKey )
3550  {
3551  lastReadKey = readKey;
3552  keyCount = 0;
3553  }
3554  else
3555  {
3556  if ( keyCount > 20 )
3557  {
3558  //Key is stable now
3559  globalKeyState = readKey;
3560  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3561  }
3562  keyCount++;
3563  }
3564  }
3565  </code>
3566  Remarks:
3567  In most of the devices only even numbered instances of timer supports
3568  32-bit mode.
3569  This function will be deprecated later, so avoid using it as much as possible.
3570  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3571 */
3572 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3573  // #ifndef _DRV_TMR_DEPRECATED_H
3574 /*******************************************************************************
3575  End of File
3576 */
3577 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3578 /* CLOSE_FILE Include File */
3579 
3580 //DOM-IGNORE-BEGIN
3581 //DOM-IGNORE-END
3582  // #ifndef _DRV_TMR_H
3583 /*******************************************************************************
3584  End of File
3585 */
3586 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3587 /* CLOSE_FILE Include File */
3588 
3589 #include "peripheral/tmr/plib_tmr.h"
3590 #include "peripheral/int/plib_int.h"
3591 // maximum divider value for 32 bit operation mode
3592 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3593 // minimum divider value for 32 bit operation mode
3594 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3595 // maximum divider value for 16 bit operation mode
3596 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3597 // minimum divider value for 16 bit operation mode
3598 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3599 // *****************************************************************************
3600 // *****************************************************************************
3601 // Section: Interface Headers for Instance 0 for the static driver
3602 // *****************************************************************************
3603 // *****************************************************************************
3604 
3605 void
3606  DRV_TMR0_Initialize ( void ) ;
3607 
3608 bool
3609  DRV_TMR0_Start ( void ) ;
3610 
3611 void
3612  DRV_TMR0_Stop ( void ) ;
3613 
3614 static inline void
3616  {
3617  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3618  DRV_TMR0_Stop () ;
3619  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3620  wl_cps_51zqendz ( 2 ) ; /* 30 */
3621  }
3622 
3623 static inline SYS_STATUS
3625 {
3626  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3627  /* Return the status as ready always */
3628  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3629  wl_cps_51zqendz ( 4 ) ; /* 30 */
3630  return
3631  SYS_STATUS_READY ;
3632 }
3633 
3634 static inline void
3635  DRV_TMR0_Open ( void )
3636  {
3637  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3638  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3639  wl_cps_51zqendz ( 6 ) ; /* 30 */
3640  }
3641 
3643  DRV_TMR0_ClientStatus ( void ) ;
3644 
3645 static inline DRV_TMR_OPERATION_MODE
3647 {
3648  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3649  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3650  wl_cps_51zqendz ( 8 ) ; /* 30 */
3651  return
3653 }
3654 
3655 static inline void
3657  {
3658  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3659  DRV_TMR0_Stop () ;
3660  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3661  wl_cps_51zqendz ( 10 ) ; /* 30 */
3662  }
3663 
3664 bool
3666  DRV_TMR_CLK_SOURCES clockSource ,
3667  TMR_PRESCALE prescale ) ;
3668 
3669 void
3671  uint32_t value ) ;
3672 
3673 uint32_t
3674  DRV_TMR0_CounterValueGet ( void ) ;
3675 
3676 void
3677  DRV_TMR0_CounterClear ( void ) ;
3678 
3679 TMR_PRESCALE
3680  DRV_TMR0_PrescalerGet ( void ) ;
3681 
3682 void
3684  uint32_t value ) ;
3685 
3686 uint32_t
3687  DRV_TMR0_PeriodValueGet ( void ) ;
3688 
3689 void
3690  DRV_TMR0_StopInIdleDisable ( void ) ;
3691 
3692 void
3693  DRV_TMR0_StopInIdleEnable ( void ) ;
3694 
3695 static inline void
3697  {
3698  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3699  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3700  wl_cps_51zqendz ( 12 ) ; /* 30 */
3701  }
3702 
3703 uint32_t
3704  DRV_TMR0_CounterFrequencyGet ( void ) ;
3705 
3708  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3709 // *****************************************************************************
3710 // *****************************************************************************
3711 // Section: Interface Headers for Instance 1 for the static driver
3712 // *****************************************************************************
3713 // *****************************************************************************
3714 
3715 void
3716  DRV_TMR1_Initialize ( void ) ;
3717 
3718 bool
3719  DRV_TMR1_Start ( void ) ;
3720 
3721 void
3722  DRV_TMR1_Stop ( void ) ;
3723 
3724 static inline void
3726  {
3727  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3728  DRV_TMR1_Stop () ;
3729  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3730  wl_cps_51zqendz ( 14 ) ; /* 30 */
3731  }
3732 
3733 static inline SYS_STATUS
3735 {
3736  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3737  /* Return the status as ready always */
3738  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3739  wl_cps_51zqendz ( 16 ) ; /* 30 */
3740  return
3741  SYS_STATUS_READY ;
3742 }
3743 
3744 static inline void
3745  DRV_TMR1_Open ( void )
3746  {
3747  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3748  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3749  wl_cps_51zqendz ( 18 ) ; /* 30 */
3750  }
3751 
3753  DRV_TMR1_ClientStatus ( void ) ;
3754 
3755 static inline DRV_TMR_OPERATION_MODE
3757 {
3758  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3759  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3760  wl_cps_51zqendz ( 20 ) ; /* 30 */
3761  return
3763 }
3764 
3765 static inline void
3767  {
3768  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3769  DRV_TMR1_Stop () ;
3770  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3771  wl_cps_51zqendz ( 22 ) ; /* 30 */
3772  }
3773 
3774 bool
3776  DRV_TMR_CLK_SOURCES clockSource ,
3777  TMR_PRESCALE prescale ) ;
3778 
3779 void
3781  uint32_t value ) ;
3782 
3783 uint32_t
3784  DRV_TMR1_CounterValueGet ( void ) ;
3785 
3786 void
3787  DRV_TMR1_CounterClear ( void ) ;
3788 
3789 TMR_PRESCALE
3790  DRV_TMR1_PrescalerGet ( void ) ;
3791 
3792 void
3794  uint32_t value ) ;
3795 
3796 uint32_t
3797  DRV_TMR1_PeriodValueGet ( void ) ;
3798 
3799 void
3800  DRV_TMR1_StopInIdleDisable ( void ) ;
3801 
3802 void
3803  DRV_TMR1_StopInIdleEnable ( void ) ;
3804 
3805 static inline void
3807  {
3808  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3809  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3810  wl_cps_51zqendz ( 24 ) ; /* 30 */
3811  }
3812 
3813 uint32_t
3814  DRV_TMR1_CounterFrequencyGet ( void ) ;
3815 
3818  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3819 // *****************************************************************************
3820 // *****************************************************************************
3821 // Section: Interface Headers for Instance 2 for the static driver
3822 // *****************************************************************************
3823 // *****************************************************************************
3824 
3825 void
3826  DRV_TMR2_Initialize ( void ) ;
3827 
3828 bool
3829  DRV_TMR2_Start ( void ) ;
3830 
3831 void
3832  DRV_TMR2_Stop ( void ) ;
3833 
3834 static inline void
3836  {
3837  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3838  DRV_TMR2_Stop () ;
3839  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3840  wl_cps_51zqendz ( 26 ) ; /* 30 */
3841  }
3842 
3843 static inline SYS_STATUS
3845 {
3846  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3847  /* Return the status as ready always */
3848  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3849  wl_cps_51zqendz ( 28 ) ; /* 30 */
3850  return
3851  SYS_STATUS_READY ;
3852 }
3853 
3854 static inline void
3855  DRV_TMR2_Open ( void )
3856  {
3857  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3858  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3859  wl_cps_51zqendz ( 30 ) ; /* 30 */
3860  }
3861 
3863  DRV_TMR2_ClientStatus ( void ) ;
3864 
3865 static inline DRV_TMR_OPERATION_MODE
3867 {
3868  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3869  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3870  wl_cps_51zqendz ( 32 ) ; /* 30 */
3871  return
3873 }
3874 
3875 static inline void
3877  {
3878  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3879  DRV_TMR2_Stop () ;
3880  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3881  wl_cps_51zqendz ( 34 ) ; /* 30 */
3882  }
3883 
3884 bool
3886  DRV_TMR_CLK_SOURCES clockSource ,
3887  TMR_PRESCALE prescale ) ;
3888 
3889 void
3891  uint32_t value ) ;
3892 
3893 uint32_t
3894  DRV_TMR2_CounterValueGet ( void ) ;
3895 
3896 void
3897  DRV_TMR2_CounterClear ( void ) ;
3898 
3899 TMR_PRESCALE
3900  DRV_TMR2_PrescalerGet ( void ) ;
3901 
3902 void
3904  uint32_t value ) ;
3905 
3906 uint32_t
3907  DRV_TMR2_PeriodValueGet ( void ) ;
3908 
3909 void
3910  DRV_TMR2_StopInIdleDisable ( void ) ;
3911 
3912 void
3913  DRV_TMR2_StopInIdleEnable ( void ) ;
3914 
3915 static inline void
3917  {
3918  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3919  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3920  wl_cps_51zqendz ( 36 ) ; /* 30 */
3921  }
3922 
3923 uint32_t
3924  DRV_TMR2_CounterFrequencyGet ( void ) ;
3925 
3928  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3929 // *****************************************************************************
3930 // *****************************************************************************
3931 // Section: Interface Headers for Instance 3 for the static driver
3932 // *****************************************************************************
3933 // *****************************************************************************
3934 
3935 void
3936  DRV_TMR3_Initialize ( void ) ;
3937 
3938 bool
3939  DRV_TMR3_Start ( void ) ;
3940 
3941 void
3942  DRV_TMR3_Stop ( void ) ;
3943 
3944 static inline void
3946  {
3947  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3948  DRV_TMR3_Stop () ;
3949  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3950  wl_cps_51zqendz ( 38 ) ; /* 30 */
3951  }
3952 
3953 static inline SYS_STATUS
3955 {
3956  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3957  /* Return the status as ready always */
3958  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3959  wl_cps_51zqendz ( 40 ) ; /* 30 */
3960  return
3961  SYS_STATUS_READY ;
3962 }
3963 
3964 static inline void
3965  DRV_TMR3_Open ( void )
3966  {
3967  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3968  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3969  wl_cps_51zqendz ( 42 ) ; /* 30 */
3970  }
3971 
3973  DRV_TMR3_ClientStatus ( void ) ;
3974 
3975 static inline DRV_TMR_OPERATION_MODE
3977 {
3978  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3979  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3980  wl_cps_51zqendz ( 44 ) ; /* 30 */
3981  return
3983 }
3984 
3985 static inline void
3987  {
3988  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3989  DRV_TMR3_Stop () ;
3990  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3991  wl_cps_51zqendz ( 46 ) ; /* 30 */
3992  }
3993 
3994 bool
3996  DRV_TMR_CLK_SOURCES clockSource ,
3997  TMR_PRESCALE prescale ) ;
3998 
3999 void
4001  uint32_t value ) ;
4002 
4003 uint32_t
4004  DRV_TMR3_CounterValueGet ( void ) ;
4005 
4006 void
4007  DRV_TMR3_CounterClear ( void ) ;
4008 
4009 TMR_PRESCALE
4010  DRV_TMR3_PrescalerGet ( void ) ;
4011 
4012 void
4014  uint32_t value ) ;
4015 
4016 uint32_t
4017  DRV_TMR3_PeriodValueGet ( void ) ;
4018 
4019 void
4020  DRV_TMR3_StopInIdleDisable ( void ) ;
4021 
4022 void
4023  DRV_TMR3_StopInIdleEnable ( void ) ;
4024 
4025 static inline void
4027  {
4028  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4029  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4030  wl_cps_51zqendz ( 48 ) ; /* 30 */
4031  }
4032 
4033 uint32_t
4034  DRV_TMR3_CounterFrequencyGet ( void ) ;
4035 
4038  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4039 // *****************************************************************************
4040 // *****************************************************************************
4041 // Section: Interface Headers for Instance 4 for the static driver
4042 // *****************************************************************************
4043 // *****************************************************************************
4044 
4045 void
4046  DRV_TMR4_Initialize ( void ) ;
4047 
4048 bool
4049  DRV_TMR4_Start ( void ) ;
4050 
4051 void
4052  DRV_TMR4_Stop ( void ) ;
4053 
4054 static inline void
4056  {
4057  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4058  DRV_TMR4_Stop () ;
4059  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4060  wl_cps_51zqendz ( 50 ) ; /* 30 */
4061  }
4062 
4063 static inline SYS_STATUS
4065 {
4066  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4067  /* Return the status as ready always */
4068  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4069  wl_cps_51zqendz ( 52 ) ; /* 30 */
4070  return
4071  SYS_STATUS_READY ;
4072 }
4073 
4074 static inline void
4075  DRV_TMR4_Open ( void )
4076  {
4077  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4078  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4079  wl_cps_51zqendz ( 54 ) ; /* 30 */
4080  }
4081 
4083  DRV_TMR4_ClientStatus ( void ) ;
4084 
4085 static inline DRV_TMR_OPERATION_MODE
4087 {
4088  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4089  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4090  wl_cps_51zqendz ( 56 ) ; /* 30 */
4091  return
4093 }
4094 
4095 static inline void
4097  {
4098  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4099  DRV_TMR4_Stop () ;
4100  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4101  wl_cps_51zqendz ( 58 ) ; /* 30 */
4102  }
4103 
4104 bool
4106  DRV_TMR_CLK_SOURCES clockSource ,
4107  TMR_PRESCALE prescale ) ;
4108 
4109 void
4111  uint32_t value ) ;
4112 
4113 uint32_t
4114  DRV_TMR4_CounterValueGet ( void ) ;
4115 
4116 void
4117  DRV_TMR4_CounterClear ( void ) ;
4118 
4119 TMR_PRESCALE
4120  DRV_TMR4_PrescalerGet ( void ) ;
4121 
4122 void
4124  uint32_t value ) ;
4125 
4126 uint32_t
4127  DRV_TMR4_PeriodValueGet ( void ) ;
4128 
4129 void
4130  DRV_TMR4_StopInIdleDisable ( void ) ;
4131 
4132 void
4133  DRV_TMR4_StopInIdleEnable ( void ) ;
4134 
4135 static inline void
4137  {
4138  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4139  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4140  wl_cps_51zqendz ( 60 ) ; /* 30 */
4141  }
4142 
4143 uint32_t
4144  DRV_TMR4_CounterFrequencyGet ( void ) ;
4145 
4148  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4149  // #ifndef _DRV_TMR_STATIC_H
4150 /*******************************************************************************
4151  End of File
4152 */
4153 
4154 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4155 /* CLOSE_FILE Include File */
4156 
4157 #include "peripheral/int/plib_int.h"
4158 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4159 /*******************************************************************************
4160  PMP Driver Interface Declarations for Static Single Instance Driver
4161  Company:
4162  Microchip Technology Inc.
4163  File Name:
4164  drv_pmp_static.h
4165  Summary:
4166  PMP driver interface declarations for the static single instance driver.
4167  Description:
4168  The PMP device driver provides a simple interface to manage the PMP
4169  modules on Microchip microcontrollers. This file defines the interface
4170  Declarations for the PMP driver.
4171 
4172  Remarks:
4173  Static interfaces incorporate the driver instance number within the names
4174  of the routines, eliminating the need for an object ID or object handle.
4175 
4176  Static single-open interfaces also eliminate the need for the open handle.
4177 *******************************************************************************/
4178 //DOM-IGNORE-BEGIN
4179 /*******************************************************************************
4180 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4181 Microchip licenses to you the right to use, modify, copy and distribute
4182 Software only when embedded on a Microchip microcontroller or digital signal
4183 controller that is integrated into your product or third party product
4184 (pursuant to the sublicense terms in the accompanying license agreement).
4185 You should refer to the license agreement accompanying this Software for
4186 additional information regarding your rights and obligations.
4187 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4188 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4189 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4190 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4191 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4192 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4193 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4194 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4195 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4196 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4197 *******************************************************************************/
4198 //DOM-IGNORE-END
4199 #ifndef _DRV_PMP_STATIC_H
4200 #define _DRV_PMP_STATIC_H
4201 #include "peripheral/pmp/plib_pmp.h"
4202 // *****************************************************************************
4203 // *****************************************************************************
4204 // Section: Interface Headers for Instance 0 for the static driver
4205 // *****************************************************************************
4206 // *****************************************************************************
4207 
4208 void
4209  DRV_PMP0_Initialize ( void ) ;
4210 
4211 void
4212  DRV_PMP0_ModeConfig ( void ) ;
4213 
4214 void
4216  PMP_DATA_WAIT_STATES dataWait ,
4217  PMP_STROBE_WAIT_STATES strobeWait ,
4218  PMP_DATA_HOLD_STATES dataHold ) ;
4219 
4220 uint8_t
4221  DRV_PMP0_Read ( void ) ;
4222 
4223 void
4224  DRV_PMP0_Write (
4225  uint8_t data ) ;
4226  // #ifndef _DRV_PMP_STATIC_H
4227 /*******************************************************************************
4228  End of File
4229 */
4230 
4231 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4232 /* CLOSE_FILE Include File */
4233 
4234 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4235 /*******************************************************************************
4236  USART Driver Interface Declarations for Static Single Instance Driver
4237  Company:
4238  Microchip Technology Inc.
4239  File Name:
4240  drv_usart_static.h
4241  Summary:
4242  USART driver interface declarations for the static single instance driver.
4243  Description:
4244  The USART device driver provides a simple interface to manage the USART
4245  modules on Microchip microcontrollers. This file defines the interface
4246  Declarations for the USART static driver.
4247  Remarks:
4248  Static interfaces incorporate the driver instance number within the names
4249  of the routines, eliminating the need for an object ID or object handle.
4250  Static single-open interfaces also eliminate the need for the open handle.
4251 *******************************************************************************/
4252 //DOM-IGNORE-BEGIN
4253 /*******************************************************************************
4254 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4255 Microchip licenses to you the right to use, modify, copy and distribute
4256 Software only when embedded on a Microchip microcontroller or digital signal
4257 controller that is integrated into your product or third party product
4258 (pursuant to the sublicense terms in the accompanying license agreement).
4259 You should refer to the license agreement accompanying this Software for
4260 additional information regarding your rights and obligations.
4261 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4262 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4263 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4264 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4265 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4266 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4267 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4268 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4269 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4270 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4271 *******************************************************************************/
4272 //DOM-IGNORE-END
4273 #ifndef _DRV_USART_STATIC_H
4274 #define _DRV_USART_STATIC_H
4275 // *****************************************************************************
4276 // *****************************************************************************
4277 // Section: Included Files
4278 // *****************************************************************************
4279 // *****************************************************************************
4280 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4281 /*******************************************************************************
4282  USART Driver Local Data Structures for static implementation
4283  Company:
4284  Microchip Technology Inc.
4285  File Name:
4286  drv_usart_static_local.h
4287  Summary:
4288  USART Driver Local Data Structures for static implementation
4289  Description:
4290  Driver Local Data Structures for static implementation
4291 *******************************************************************************/
4292 //DOM-IGNORE-BEGIN
4293 /*******************************************************************************
4294 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4295 Microchip licenses to you the right to use, modify, copy and distribute Software
4296 only when embedded on a Microchip microcontroller or digital signal controller
4297 that is integrated into your product or third party product (pursuant to the
4298 sublicense terms in the accompanying license agreement).
4299 You should refer to the license agreement accompanying this Software for
4300 additional information regarding your rights and obligations.
4301 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4302 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4303 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4304 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4305 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4306 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4307 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4308 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4309 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4310 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4311 *******************************************************************************/
4312 //DOM-IGNORE-END
4313 #ifndef _DRV_USART_STATIC_LOCAL_H
4314 #define _DRV_USART_STATIC_LOCAL_H
4315 // *****************************************************************************
4316 // *****************************************************************************
4317 // Section: Included Files
4318 // *****************************************************************************
4319 // *****************************************************************************
4320 #include <stdint.h>
4321 #include <stdbool.h>
4322 #include <stddef.h>
4323 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4324 /*******************************************************************************
4325  USART Driver Interface Header File
4326  Company:
4327  Microchip Technology Inc.
4328  File Name:
4329  drv_usart.h
4330  Summary:
4331  USART Driver Interface Header File
4332  Description:
4333  The USART device driver provides a simple interface to manage the USART or
4334  UART modules on Microchip microcontrollers. This file provides the
4335  interface definition for the USART driver.
4336 *******************************************************************************/
4337 //DOM-IGNORE-BEGIN
4338 /*******************************************************************************
4339 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4340 Microchip licenses to you the right to use, modify, copy and distribute
4341 Software only when embedded on a Microchip microcontroller or digital signal
4342 controller that is integrated into your product or third party product
4343 (pursuant to the sublicense terms in the accompanying license agreement).
4344 You should refer to the license agreement accompanying this Software for
4345 additional information regarding your rights and obligations.
4346 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4347 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4348 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4349 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4350 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4351 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4352 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4353 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4354 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4355 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4356 *******************************************************************************/
4357 //DOM-IGNORE-END
4358 #ifndef _DRV_USART_H
4359 #define _DRV_USART_H
4360 // *****************************************************************************
4361 // *****************************************************************************
4362 // Section: File includes
4363 // *****************************************************************************
4364 // *****************************************************************************
4365 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4366 /*******************************************************************************
4367  USART Driver Definitions Header File
4368  Company:
4369  Microchip Technology Inc.
4370  File Name:
4371  drv_usart_definitions.h
4372  Summary:
4373  USART Driver Definitions Header File
4374  Description:
4375  This file will provide enumerations and other dependencies needed by
4376  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4377 *******************************************************************************/
4378 //DOM-IGNORE-BEGIN
4379 /*******************************************************************************
4380 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4381 Microchip licenses to you the right to use, modify, copy and distribute
4382 Software only when embedded on a Microchip microcontroller or digital signal
4383 controller that is integrated into your product or third party product
4384 (pursuant to the sublicense terms in the accompanying license agreement).
4385 You should refer to the license agreement accompanying this Software for
4386 additional information regarding your rights and obligations.
4387 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4388 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4389 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4390 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4391 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4392 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4393 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4394 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4395 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4396 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4397 *******************************************************************************/
4398 //DOM-IGNORE-END
4399 #ifndef _DRV_USART_DEFINITIONS_H
4400 #define _DRV_USART_DEFINITIONS_H
4401 // *****************************************************************************
4402 // *****************************************************************************
4403 // Section: File includes
4404 // *****************************************************************************
4405 // *****************************************************************************
4406 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4407 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4408 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4409 /*******************************************************************************
4410  USART Peripheral Library Interface Header
4411  Company:
4412  Microchip Technology Inc.
4413  File Name:
4414  plib_usart.h
4415  Summary:
4416  USART Peripheral Library interface header.
4417  Description:
4418  This header file contains the function prototypes and definitions of
4419  the data types and constants that make up the interface to the USART
4420  Peripheral Library for all families of Microchip microcontrollers. The
4421  functions in this file are common to the USART module.
4422  *******************************************************************************/
4423 // DOM-IGNORE-BEGIN
4424 /*******************************************************************************
4425 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4426 Microchip licenses to you the right to use, modify, copy and distribute
4427 Software only when embedded on a Microchip microcontroller or digital signal
4428 controller that is integrated into your product or third party product
4429 (pursuant to the sublicense terms in the accompanying license agreement).
4430 You should refer to the license agreement accompanying this Software for
4431 additional information regarding your rights and obligations.
4432 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4433 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4434 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4435 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4436 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4437 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4438 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4439 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4440 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4441 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4442  *******************************************************************************/
4443 // DOM-IGNORE-END
4444 #ifndef _PLIB_USART_H
4445 #define _PLIB_USART_H
4446 // DOM-IGNORE-BEGIN
4447 // DOM-IGNORE-END
4448 // ****************************************************************************
4449 // ****************************************************************************
4450 // Section: Included Files
4451 // ****************************************************************************
4452 // ****************************************************************************
4453 /* This section lists the other files that are included in this file.
4454 */
4455 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4456 /*******************************************************************************
4457  Processor Selector File for the USART
4458  Company:
4459  Microchip Technology Incorporated
4460  File Name:
4461  processor.h
4462  Summary:
4463  Selects the appropriate header for the part family
4464  Description:
4465  This file selects the appropriate header for the part family
4466  *******************************************************************************/
4467 // DOM-IGNORE-BEGIN
4468 /*******************************************************************************
4469 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4470 Microchip licenses to you the right to use, modify, copy and distribute
4471 Software only when embedded on a Microchip microcontroller or digital signal
4472 controller that is integrated into your product or third party product
4473 (pursuant to the sublicense terms in the accompanying license agreement).
4474 You should refer to the license agreement accompanying this Software for
4475 additional information regarding your rights and obligations.
4476 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4477 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4478 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4479 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4480 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4481 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4482 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4483 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4484 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4485 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4486  *******************************************************************************/
4487 // DOM-IGNORE-END
4488 #ifndef _USART_PROCESSOR_H
4489 #define _USART_PROCESSOR_H
4490 // *****************************************************************************
4491 // *****************************************************************************
4492 // Section: Included Files
4493 // *****************************************************************************
4494 // *****************************************************************************
4495 /* This section lists the other files that are included in this file.
4496  */
4497 #include <stdint.h>
4498 #include <stdbool.h>
4499 #error "No Processor Family specified"
4500  //
4501  // _USART_PROCESSOR_H
4502 /*******************************************************************************
4503  End of File
4504  */
4505 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4506 /* CLOSE_FILE Include File */
4507 
4508 // ****************************************************************************
4509 // ****************************************************************************
4510 // Section: USART Peripheral Library Interface Functions
4511 // ****************************************************************************
4512 // ****************************************************************************
4513 //******************************************************************************
4514 /* Function:
4515  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4516  Summary:
4517  Enables the USART module to continue to operate when an overflow error
4518  condition has occurred.
4519  Description:
4520  This function enables the USART module to continue to operate when an
4521  overflow error condition has occurred.
4522  This operation is atomic.
4523  Precondition:
4524  None.
4525  Parameters:
4526  index - Identifier for the device instance to be configured
4527  Returns:
4528  None.
4529  Example:
4530  <code>
4531 #define MY_USART_INSTANCE USART_ID_1
4532  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4533  </code>
4534  Remarks:
4535  This feature may not be available on all devices. Please refer to the
4536  specific device data sheet to determine availability or use
4537  PLIB_USART_ExistsRunInOverflow in your application to determine
4538  whether this feature is available.
4539 */
4540 
4541 void
4543  USART_MODULE_ID index ) ;
4544 //******************************************************************************
4545 /* Function:
4546  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4547  Summary:
4548  Disables the Run in overflow condition mode.
4549  Description:
4550  This function disables the USART module from accepting new data when an overflow
4551  error condition is detected.
4552  This operation is atomic.
4553  Precondition:
4554  None.
4555  Parameters:
4556  index - Identifier for the device instance to be configured
4557  Returns:
4558  None.
4559  Example:
4560  <code>
4561 #define MY_USART_INSTANCE USART_ID_1
4562  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4563  </code>
4564  Remarks:
4565  This feature may not be available on all devices. Please refer to the
4566  specific device data sheet to determine availability or use
4567  PLIB_USART_ExistsRunInOverflow in your application to determine
4568  whether this feature is available.
4569 */
4570 
4571 void
4573  USART_MODULE_ID index ) ;
4574 //******************************************************************************
4575 /* Function:
4576  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4577  Summary:
4578  Gets the status of the Run in Overflow condition.
4579  Description:
4580  This function indicates if the USART module has been enabled to run in
4581  an overflow condition.
4582  This operation is atomic.
4583  Precondition:
4584  None.
4585  Parameters:
4586  index - Identifier for the device instance
4587  Returns:
4588  - true - Run in overflow condition is enabled
4589  - false - Run in overflow condition is disabled
4590  Example:
4591  <code>
4592 #define MY_USART_INSTANCE USART_ID_1
4593  bool status;
4594  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4595  </code>
4596  Remarks:
4597  This feature may not be available on all devices. Please refer to the
4598  specific device data sheet to determine availability or use
4599  PLIB_USART_ExistsRunInOverflow in your application to determine
4600  whether this feature is available.
4601 */
4602 
4603 bool
4605  USART_MODULE_ID index ) ;
4606 //******************************************************************************
4607 /* Function:
4608  void PLIB_USART_BRGClockSourceSelect
4609  (
4610  USART_MODULE_ID index,
4611  USART_BRG_CLOCK_SOURCE brgClockSource
4612  )
4613  Summary:
4614  Configures the BRG clock source of the USART module.
4615  Description:
4616  This function configures the BRG Clock source of the USART. Refer to
4617  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4618  Precondition:
4619  None.
4620  Parameters:
4621  index - Identifier for the device instance to be configured
4622  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4623  Returns:
4624  None.
4625  Example:
4626  <code>
4627 #define MY_USART_INSTANCE USART_ID_1
4628  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4629  </code>
4630  Remarks:
4631  This feature may not be available on all devices. Please refer to the
4632  specific device data sheet to determine availability or use
4633  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4634  whether this feature is available.
4635 */
4636 
4637 void
4639  USART_MODULE_ID index ,
4640  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4641 //******************************************************************************
4642 /* Function:
4643  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4644  Summary:
4645  Gets the BRG clock source of the USART module.
4646  Description:
4647  This function returns the BRG Clock source of the USART. Refer to
4648  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4649  This operation is atomic.
4650  Precondition:
4651  None.
4652  Parameters:
4653  index - Identifier for the device instance
4654  Returns:
4655  One of the possible values of USART_BRG_CLOCK_SOURCE
4656  Example:
4657  <code>
4658 #define MY_USART_INSTANCE USART_ID_1
4659  USART_BRG_CLOCK_SOURCE brgClockSource;
4660  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4661  </code>
4662  Remarks:
4663  This feature may not be available on all devices. Please refer to the
4664  specific device data sheet to determine availability or use
4665  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4666  whether this feature is available.
4667 */
4668 
4669 USART_BRG_CLOCK_SOURCE
4671  USART_MODULE_ID index ) ;
4672 //******************************************************************************
4673 /* Function:
4674  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4675  Summary:
4676  Returns the USART module's running status.
4677  Description:
4678  This function checks if the USART module status is busy. The following
4679  functions should not be used when the module status is busy:
4680  - PLIB_USART_LineControlModeSelect
4681  - PLIB_USART_BaudRateHighSet
4682  - PLIB_USART_BaudRateHighEnable
4683  - PLIB_USART_BaudRateHighDisable
4684  - PLIB_USART_ReceiverIdleStateLowEnable
4685  - PLIB_USART_ReceiverIdleStateLowDisable
4686  - PLIB_USART_BaudRateAutoDetectEnable
4687  - PLIB_USART_LoopbackEnable
4688  - PLIB_USART_LoopbackDisable
4689  - PLIB_USART_WakeOnStartEnable
4690  - PLIB_USART_WakeOnStartDisable
4691  - PLIB_USART_OperationModeSelect
4692  - PLIB_USART_HandshakeModeSelect
4693  - PLIB_USART_IrDAEnable
4694  - PLIB_USART_IrDADisable
4695  - PLIB_USART_StopInIdleEnable
4696  - PLIB_USART_StopInIdleDisable
4697  - PLIB_USART_RunInOverflowEnable
4698  - PLIB_USART_RunInOverflowDisable
4699  - PLIB_USART_BRGClockSourceSelect
4700  - PLIB_USART_RunInSleepModeEnable
4701  - PLIB_USART_RunInSleepModeDisable
4702  This operation is atomic.
4703  Precondition:
4704  None.
4705  Parameters:
4706  index - Identifier for the device instance
4707  Returns:
4708  - true - USART module is busy
4709  - false - USART module is idle
4710  Example:
4711  <code>
4712 #define MY_USART_INSTANCE USART_ID_1
4713  bool moduleStatus;
4714  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4715  </code>
4716  Remarks:
4717  This feature may not be available on all devices. Please refer to the
4718  specific device data sheet to determine availability or use
4719  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4720  whether this feature is available.
4721 */
4722 
4723 bool
4725  USART_MODULE_ID index ) ;
4726 //******************************************************************************
4727 /* Function:
4728  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4729  Summary:
4730  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4731  Description:
4732  This function enables the USART module's BRG clock to continue operation when
4733  the device enters the Sleep mode.
4734  This operation is atomic.
4735  Precondition:
4736  None.
4737  Parameters:
4738  index - Identifier for the device instance to be configured
4739  Returns:
4740  None.
4741  Example:
4742  <code>
4743 #define MY_USART_INSTANCE USART_ID_1
4744  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4745  </code>
4746  Remarks:
4747  This feature may not be available on all devices. Please refer to the
4748  specific device data sheet to determine availability or use
4749  PLIB_USART_ExistsRunInSleepMode in your application to determine
4750  whether this feature is available.
4751 */
4752 
4753 void
4755  USART_MODULE_ID index ) ;
4756 //******************************************************************************
4757 /* Function:
4758  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4759  Summary:
4760  Turns off the USART module's BRG clock during Sleep mode.
4761  Description:
4762  This function turns off the USART module's BRG clock during Sleep mode.
4763  This operation is atomic.
4764  Precondition:
4765  None.
4766  Parameters:
4767  index - Identifier for the device instance to be configured
4768  Returns:
4769  None.
4770  Example:
4771  <code>
4772 #define MY_USART_INSTANCE USART_ID_1
4773  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4774  </code>
4775  Remarks:
4776  This feature may not be available on all devices. Please refer to the
4777  specific device data sheet to determine availability or use
4778  PLIB_USART_ExistsRunInSleepMode in your application to determine
4779  whether this feature is available.
4780 */
4781 
4782 void
4784  USART_MODULE_ID index ) ;
4785 //******************************************************************************
4786 /* Function:
4787  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4788  Summary:
4789  Gets the status of Run in Sleep mode.
4790  Description:
4791  This function indicates if the USART module has been enabled to run in
4792  Sleep mode.
4793  This operation is atomic.
4794  Precondition:
4795  None.
4796  Parameters:
4797  index - Identifier for the device instance
4798  Returns:
4799  - true - Run in Sleep mode is enabled
4800  - false - Run in Sleep mode is disabled
4801  Example:
4802  <code>
4803 #define MY_USART_INSTANCE USART_ID_1
4804  bool status;
4805  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4806  </code>
4807  Remarks:
4808  This feature may not be available on all devices. Please refer to the
4809  specific device data sheet to determine availability or use
4810  PLIB_USART_ExistsRunInSleepMode in your application to determine
4811  whether this feature is available.
4812 */
4813 
4814 bool
4816  USART_MODULE_ID index ) ;
4817 //******************************************************************************
4818 /* Function:
4819  void PLIB_USART_Enable ( USART_MODULE_ID index )
4820  Summary:
4821  Enables the specific USART module.
4822  Description:
4823  This function enables the specific USART module.
4824  This operation is atomic.
4825  Precondition:
4826  None.
4827  Parameters:
4828  index - Identifier for the device instance to be configured
4829  Returns:
4830  None.
4831  Example:
4832  <code>
4833 #define MY_USART_INSTANCE USART_ID_1
4834  PLIB_USART_Enable(MY_USART_INSTANCE);
4835  </code>
4836  Remarks:
4837  By calling this function, the USART pins are controlled by the USART
4838  module.
4839  This feature may not be available on all devices. Please refer to the
4840  specific device data sheet to determine availability or use
4841  PLIB_USART_ExistsEnable in your application to determine whether
4842  this feature is available.
4843 */
4844 
4845 void
4847  USART_MODULE_ID index ) ;
4848 //******************************************************************************
4849 /* Function:
4850  void PLIB_USART_Disable ( USART_MODULE_ID index )
4851  Summary:
4852  Disables the specific USART module
4853  Description:
4854  This function disables the specific USART module.
4855  This operation is atomic.
4856  Precondition:
4857  None.
4858  Parameters:
4859  index - Identifier for the device instance to be configured
4860  Returns:
4861  None.
4862  Example:
4863  <code>
4864 #define MY_USART_INSTANCE USART_ID_1
4865  PLIB_USART_Disable(MY_USART_INSTANCE);
4866  </code>
4867  Remarks:
4868  The default state after any reset for a USART module is the disable state.
4869  If the USART is disabled, all of the related pins are in control of the
4870  general purpose I/O logic.
4871 
4872  Disabling the USART module resets the buffers to empty states. Any data
4873  characters in the buffers are lost and the baud rate is reset. All error
4874  and status bits are also reset.
4875 
4876  Disabling the USART while the USART is active, will abort all pending
4877  transmissions and receptions. Re-enabling the USART will restart the
4878  module in the same configuration.
4879 
4880  When disabled, the USART power consumption is minimal.
4881  This feature may not be available on all devices. Please refer to the
4882  specific device data sheet to determine availability or use
4883  PLIB_USART_ExistsEnable in your application to determine whether
4884  this feature is available.
4885 */
4886 
4887 void
4889  USART_MODULE_ID index ) ;
4890 //******************************************************************************
4891 /* Function:
4892  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4893  Summary:
4894  Enables the specific USART module transmitter.
4895  Description:
4896  This function enables the specific USART module transmitter.
4897  This operation is atomic.
4898  Precondition:
4899  The USART module should be enabled using the function PLIB_USART_Enable
4900  before this function is called.
4901  Parameters:
4902  index - Identifier for the device instance to be configured
4903  Returns:
4904  None.
4905  Example:
4906  <code>
4907 #define MY_USART_INSTANCE USART_ID_1
4908  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4909  </code>
4910  Remarks:
4911  The transmitter should not be enabled until the USART is enabled.
4912  The transmissions will not be enabled otherwise.
4913 
4914  This feature may not be available on all devices. Please refer to the
4915  specific device data sheet to determine availability or use
4916  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4917  this feature is available.
4918 */
4919 
4920 void
4922  USART_MODULE_ID index ) ;
4923 //******************************************************************************
4924 /* Function:
4925  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4926  Summary:
4927  Disables the specific USART module transmitter.
4928  Description:
4929  This function disables the specific USART module transmitter.
4930  This operation is atomic.
4931  Precondition:
4932  None.
4933  Parameters:
4934  index - Identifier for the device instance to be configured
4935  Returns:
4936  None.
4937  Example:
4938  <code>
4939 #define MY_USART_INSTANCE USART_ID_1
4940  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4941  </code>
4942  Remarks:
4943  Disabling the transmitter during a transmission will cause the
4944  transmission to be aborted.
4945 
4946  This feature may not be available on all devices. Please refer to the
4947  specific device data sheet to determine availability or use
4948  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4949  this feature is available.
4950 */
4951 
4952 void
4954  USART_MODULE_ID index ) ;
4955 //******************************************************************************
4956 /* Function:
4957  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4958  uint32_t baudRate );
4959  Summary:
4960  Sets the baud rate to the desired value.
4961  Description:
4962  This function sets the baud rate to the desired value.
4963  Precondition:
4964  None.
4965  Parameters:
4966  index - Identifier for the device instance to be configured
4967  baudRate - Baud Rate Value
4968  clockFrequency - Clock Frequency
4969  Returns:
4970  None.
4971  Example:
4972  <code>
4973 #define MY_USART_INSTANCE USART_ID_1
4974  uint32_t baudRateValue ;
4975  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4976  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4977  </code>
4978  Remarks:
4979  Setting a new baud rate value causes the baud rate timer to reset.
4980  This ensures that the baud rate timer does not have to overflow before
4981  outputting the new baud rate.
4982 
4983  If the system clock is changed during an active receive operation, a
4984  receiver error or data loss may result. To avoid this issue verify that
4985  no receptions are in progress before changing the system clock.
4986 
4987  This feature may not be available on all devices. Please refer to the
4988  specific device data sheet to determine availability or use
4989  PLIB_USART_ExistsBaudRate in your application to determine whether
4990  this feature is available.
4991 */
4992 
4993 void
4995  USART_MODULE_ID index ,
4996  uint32_t clockFrequency ,
4997  uint32_t baudRate ) ;
4998 //******************************************************************************
4999 /* Function:
5000  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5001  uint32_t clockFrequency, uint32_t baudRate );
5002  Summary:
5003  Sets the baud rate to the desired value.
5004  Description:
5005  This function sets the baud rate to the desired value.
5006  Precondition:
5007  None.
5008  Parameters:
5009  index - Identifier for the device instance to be configured
5010  baudRate - Baud Rate Value, it is the baud rate value
5011  clockFrequency - Clock Frequency
5012  Returns:
5013  None.
5014  Example:
5015  <code>
5016 #define MY_USART_INSTANCE USART_ID_1
5017  uint32_t baudRateValue ;
5018  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5019  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5020  </code>
5021  Remarks:
5022  Setting a new baud rate value causes the baud rate timer to reset.
5023  This ensures that the baud rate timer does not have to overflow before
5024  outputting the new baud rate.
5025 
5026  If the system clock is changed during an active receive operation, a
5027  receiver error or data loss may result. To avoid this issue verify that
5028  no receptions are in progress before changing the system clock.
5029 
5030  This feature may not be available on all devices. Please refer to the
5031  specific device data sheet to determine availability or use
5032  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5033  this feature is available.
5034 */
5035 
5036 void
5038  USART_MODULE_ID index ,
5039  uint32_t clockFrequency ,
5040  uint32_t baudRate ) ;
5041 //******************************************************************************
5042 /* Function:
5043  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5044  int32_t clockFrequency );
5045  Summary:
5046  Gets the baud rate current in use.
5047  Description:
5048  This function gets the baud rate that is currently in use. The clock frequency
5049  needs to be passed to the function.
5050  Conditions:
5051  None.
5052  Input:
5053  index - Identifier for the device instance to be configured
5054  clockFrequency - Clock Frequency
5055  Returns:
5056  - BaudRate - Baud rate value
5057  Example:
5058  <code>
5059 #define MY_USART_INSTANCE USART_ID_1
5060  uint32_t baudRate ;
5061  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5062  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5063  </code>
5064  Remarks:
5065  This feature may not be available on all devices. Please refer to the
5066  specific device data sheet to determine availability or use
5067  PLIB_USART_ExistsBaudRate in your application to determine whether
5068  this feature is available.
5069 */
5070 
5071 uint32_t
5073  USART_MODULE_ID index ,
5074  int32_t clockFrequency ) ;
5075 //******************************************************************************
5076 /* Function:
5077  void PLIB_USART_AddressSet
5078  (
5079  USART_MODULE_ID index,
5080  uint8_t address
5081  )
5082  Summary:
5083  Sets the address for the Address Detect mode.
5084  Description:
5085  This function sets the address for the Address Detect mode.
5086  This operation is atomic.
5087  Precondition:
5088  None.
5089  Parameters:
5090  index - Identifier for the device instance to be configured
5091  address - Address
5092  Returns:
5093  None.
5094  Example:
5095  <code>
5096 #define MY_USART_INSTANCE USART_ID_1
5097  uint8_t address = 0x02;
5098  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5099  </code>
5100  Remarks:
5101  This feature may not be available on all devices. Please refer to the
5102  specific device data sheet to determine availability or use
5103  PLIB_USART_ExistsReceiverAddress in your application to determine
5104  whether this feature is available.
5105 */
5106 
5107 void
5109  USART_MODULE_ID index ,
5110  uint8_t address ) ;
5111 //******************************************************************************
5112 /* Function:
5113  uint8_t PLIB_USART_AddressGet
5114  (
5115  USART_MODULE_ID index
5116  )
5117  Summary:
5118  Gets the address for the Address Detect mode.
5119  Description:
5120  This function returns the address value being used for the Address
5121  Detect mode.
5122  This operation is atomic.
5123  Precondition:
5124  None.
5125  Parameters:
5126  index - Identifier for the device instance
5127  Returns:
5128  - address - The address being used
5129  Example:
5130  <code>
5131 #define MY_USART_INSTANCE USART_ID_1
5132  uint8_t address = 0;
5133  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5134  </code>
5135  Remarks:
5136  This feature may not be available on all devices. Please refer to the
5137  specific device data sheet to determine availability or use
5138  PLIB_USART_ExistsReceiverAddress in your application to determine
5139  whether this feature is available.
5140 */
5141 
5142 uint8_t
5144  USART_MODULE_ID index ) ;
5145 //******************************************************************************
5146 /* Function:
5147  void PLIB_USART_AddressMaskSet
5148  (
5149  USART_MODULE_ID index,
5150  uint8_t mask
5151  )
5152  Summary:
5153  Sets the address mask for the Address Detect mode.
5154  Description:
5155  This function sets the address mask for the Address Detect mode.
5156  This operation is atomic.
5157  Precondition:
5158  None.
5159  Parameters:
5160  index - Identifier for the device instance to be configured
5161  mask - Address match mask bits
5162  Returns:
5163  None.
5164  Example:
5165  <code>
5166 #define MY_USART_INSTANCE USART_ID_1
5167  uint8_t mask = 0x0F;
5168  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5169  </code>
5170  Remarks:
5171  This feature may not be available on all devices. Please refer to the
5172  specific device data sheet to determine availability or use
5173  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5174  whether this feature is available.
5175 */
5176 
5177 void
5179  USART_MODULE_ID index ,
5180  uint8_t mask ) ;
5181 //******************************************************************************
5182 /* Function:
5183  uint8_t PLIB_USART_AddressMaskGet
5184  (
5185  USART_MODULE_ID index
5186  )
5187  Summary:
5188  Gets the address mask for the Address Detect mode.
5189  Description:
5190  This function returns the address mask value being used for the Address
5191  Detect mode.
5192  This operation is atomic.
5193  Precondition:
5194  None.
5195  Parameters:
5196  index - Identifier for the device instance to be configured
5197  Returns:
5198  - mask - Address mask being used
5199  Example:
5200  <code>
5201 #define MY_USART_INSTANCE USART_ID_1
5202  uint8_t mask = 0;
5203  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5204  </code>
5205  Remarks:
5206  This feature may not be available on all devices. Please refer to the
5207  specific device data sheet to determine availability or use
5208  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5209  whether this feature is available.
5210 */
5211 
5212 uint8_t
5214  USART_MODULE_ID index ) ;
5215 //******************************************************************************
5216 /* Function:
5217  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5218  Summary:
5219  Enables the Address Detect mode.
5220  Description:
5221  This function enables the Address Detect mode. If it is enabled, and the
5222  device is addressed, disable the Address Detect mode to continue receiving
5223  bytes.
5224  This operation is atomic.
5225  Precondition:
5226  None.
5227  Parameters:
5228  index - Identifier for the device instance to be configured
5229  Returns:
5230  None.
5231  Example:
5232  <code>
5233 #define MY_USART_INSTANCE USART_ID_1
5234  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5235  </code>
5236  Remarks:
5237  If 9 data bits are not selected, this bit has no effect.
5238  This feature may not be available on all devices. Please refer to the
5239  specific device data sheet to determine availability or use
5240  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5241  this feature is available.
5242 */
5243 
5244 void
5246  USART_MODULE_ID index ) ;
5247 //******************************************************************************
5248 /* Function:
5249  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5250  Summary:
5251  Enables the Address Detect mode.
5252  Description:
5253  This function disables the Address Detect mode. If it is enabled, and the
5254  device is addressed, disable the Address Detect mode to continue receiving
5255  bytes.
5256  This operation is atomic.
5257  Precondition:
5258  None.
5259  Parameters:
5260  index - Identifier for the device instance to be configured
5261  Returns:
5262  None.
5263  Example:
5264  <code>
5265 #define MY_USART_INSTANCE USART_ID_1
5266  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5267  </code>
5268  Remarks:
5269  All bytes are received, and the 9th bit can be used as the parity bit.
5270  By default, the address detect is disabled.
5271 
5272  This feature may not be available on all devices. Please refer to the
5273  specific device data sheet to determine availability or use
5274  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5275  this feature is available.
5276 */
5277 
5278 void
5280  USART_MODULE_ID index ) ;
5281 //******************************************************************************
5282 /* Function:
5283  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5284  Summary:
5285  Gets the state of the automatic baud detection.
5286  Description:
5287  This function gets the state of the automatic baud detection and returns a '0'
5288  if the baud rate auto detection is complete.
5289  This operation is atomic.
5290  Precondition:
5291  None.
5292  Parameters:
5293  index - Identifier for the device instance to be configured
5294  Returns:
5295  - true - Baud rate detection is not complete
5296  - false - Baud rate detection is complete
5297  Example:
5298  <code>
5299 #define MY_USART_INSTANCE USART_ID_1
5300  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5301  // Wait until the baud rate is detected.
5302  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5303  </code>
5304  Remarks:
5305  This feature may not be available on all devices. Please refer to the
5306  specific device data sheet to determine availability or use
5307  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5308  this feature is available.
5309 */
5310 
5311 bool
5313  USART_MODULE_ID index ) ;
5314 //******************************************************************************
5315 /* Function:
5316  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5317  Summary:
5318  Enables baud rate measurement on the next character, which requires reception
5319  of the Sync character.
5320  Description:
5321  This function enables the baud rate measurement on the next character,
5322  which requires reception of the Sync character.
5323  This operation is atomic.
5324  Precondition:
5325  None.
5326  Parameters:
5327  index - Identifier for the device instance to be configured
5328  Returns:
5329  None.
5330  Example:
5331  <code>
5332 #define MY_USART_INSTANCE USART_ID_1
5333  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5334  // Wait until the baud rate is detected.
5335  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5336  </code>
5337  Remarks:
5338  This feature may not be available on all devices. Please refer to the
5339  specific device data sheet to determine availability or use
5340  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5341  this feature is available.
5342 */
5343 
5344 void
5346  USART_MODULE_ID index ) ;
5347 //******************************************************************************
5348 /* Function:
5349  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5350  Summary:
5351  Data to be transmitted in the Byte mode.
5352  Description:
5353  The data is transmitted in the Byte mode for the specified USART module.
5354  This operation is atomic.
5355  Precondition:
5356  None.
5357  Parameters:
5358  index - Identifier for the device instance to be configured
5359  data - Data to be transmitted.
5360  Returns:
5361  None.
5362  Example:
5363  <code>
5364 #define MY_USART_INSTANCE USART_ID_1
5365  uint8_t data = 'a';
5366  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5367  {
5368  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5369  }
5370  </code>
5371  Remarks:
5372  This feature may not be available on all devices. Please refer to the
5373  specific device data sheet to determine availability or use
5374  PLIB_USART_ExistsTransmitter in your application to determine whether
5375  this feature is available.
5376 */
5377 
5378 void
5380  USART_MODULE_ID index ,
5381  int8_t data ) ;
5382 //******************************************************************************
5383 /* Function:
5384  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5385  Summary:
5386  Data to be received in the Byte mode.
5387  Description:
5388  The data to be received in Byte mode from the specified USART module.
5389  This operation is atomic.
5390  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5391  PLIB_USART_ReceiverParityErrorHasOccurred and
5392  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5393  Precondition:
5394  None.
5395  Parameters:
5396  index - Identifier for the device instance to be configured
5397  Returns:
5398  - data - Data to be received
5399  Example:
5400  <code>
5401 #define MY_USART_INSTANCE USART_ID_1
5402  bool isError;
5403  uint8_t mydata;
5404  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5405  {
5406  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5407  }
5408  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5409  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5410  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5411  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5412  {
5413  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5414  }
5415  </code>
5416  Remarks:
5417  This feature may not be available on all devices. Please refer to the
5418  specific device data sheet to determine availability or use
5419  PLIB_USART_ExistsReceiver in your application to determine whether
5420  this feature is available.
5421 */
5422 
5423 int8_t
5425  USART_MODULE_ID index ) ;
5426 //******************************************************************************
5427 /* Function:
5428  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5429  Summary:
5430  Data to be received in the byte mode with the 9th bit.
5431  Description:
5432  The data to be received in Byte mode from the specified USART module.
5433  with the 9th bit.
5434  This operation is atomic.
5435  Precondition:
5436  None.
5437  Parameters:
5438  index - Identifier for the device instance to be configured
5439  Returns:
5440  - data - Data to be received
5441  Example:
5442  <code>
5443 #define MY_USART_INSTANCE USART_ID_1
5444  uint16_t mydata;
5445  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5446  {
5447  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5448  }
5449  </code>
5450  Remarks:
5451  This feature may not be available on all devices. Please refer to the
5452  specific device data sheet to determine availability or use
5453  PLIB_USART_ExistsReceiver9Bits in your application to determine
5454  whether this feature is available.
5455 */
5456 
5457 int16_t
5459  USART_MODULE_ID index ) ;
5460 //******************************************************************************
5461 /* Function:
5462  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5463  Summary:
5464  Checks and return if the data received is an address.
5465  Description:
5466  Checks and return if the data received is an address. The address has
5467  the 9th bit set. If data received has the 9th bit set, the function returns true;
5468  otherwise, the function returns false.
5469  This operation is atomic.
5470  Precondition:
5471  The USART module should be configured to use the 9 data bits.
5472  Parameters:
5473  index - Identifier for the device instance to be configured
5474  Returns:
5475  - true - if the data received has the 9th bit set
5476  - false - if the address received has the 9th bit cleared
5477  Example:
5478  <code>
5479 #define MY_USART_INSTANCE USART_ID_1
5480  int8_t address;
5481  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5482  {
5483  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5484  }
5485  </code>
5486  Remarks:
5487  This feature may not be available on all devices. Please refer to the
5488  specific device data sheet to determine availability or use
5489  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5490  this feature is available.
5491 */
5492 
5493 bool
5495  USART_MODULE_ID index ) ;
5496 //******************************************************************************
5497 /* Function:
5498  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5499  int8_t data, bool 9thBit )
5500  Summary:
5501  Data to be transmitted in the byte mode with the 9th bit.
5502  Description:
5503  The data is transmitted in the byte mode for the specified USART module,
5504  with 9th bit.
5505  This operation is atomic.
5506  Precondition:
5507  The USART module should be configured to use the 9 data bits.
5508  Parameters:
5509  index - Identifier for the device instance to be configured
5510  data - Data to be transmitted.
5511  9thBit - 9th bit of the data to be transmitted.
5512  Returns:
5513  None.
5514  Example:
5515  <code>
5516 #define MY_USART_INSTANCE USART_ID_1
5517  uint8_t data = 'a';
5518  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5519  {
5520  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5521  }
5522  </code>
5523  Remarks:
5524  This feature may not be available on all devices. Please refer to the
5525  specific device data sheet to determine availability or use
5526  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5527  this feature is available.
5528 */
5529 
5530 void
5532  USART_MODULE_ID index ,
5533  int8_t data ,
5534  bool Bit9th ) ;
5535 //******************************************************************************
5536 /* Function:
5537  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5538  Summary:
5539  Transmits the break character.
5540  Description:
5541  This function transmits the break character.
5542  This operation is atomic.
5543  Precondition:
5544  The application should wait for the transmitter to be idle, before calling
5545  this function.
5546  Parameters:
5547  index - Identifier for the device instance to be configured
5548  Returns:
5549  None.
5550  Example:
5551  <code>
5552 #define MY_USART_INSTANCE USART_ID_1
5553  // Wait for the Transmit buffer to be empty.
5554  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5555  // Transmit the break character.
5556  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5557  // wait for the break transmission to complete
5558  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5559  </code>
5560  Remarks:
5561  After the break has been transmitted, the application can start
5562  transmitting next bytes.
5563 
5564  This feature may not be available on all devices. Please refer to the
5565  specific device data sheet to determine availability or use
5566  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5567  this feature is available.
5568 */
5569 
5570 void
5572  USART_MODULE_ID index ) ;
5573 //******************************************************************************
5574 /* Function:
5575  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5576  Summary:
5577  Returns the status of the break transmission
5578  Description:
5579  The function returns the status of the break transmission.
5580  This operation is atomic.
5581  Precondition:
5582  None.
5583  Parameters:
5584  index - Identifier for the device instance to be configured
5585  Returns:
5586  - true - Transmit break on the next transmission
5587  - false - Break transmission completed or not started
5588  Example:
5589  <code>
5590 #define MY_USART_INSTANCE USART_ID_1
5591  // Wait for the Transmit buffer to be empty.
5592  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5593  // Transmit the break character.
5594  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5595  // wait for the break transmission to complete
5596  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5597  </code>
5598  Remarks:
5599  After the break has been transmitted, the application can start
5600  transmitting next bytes.
5601 
5602  This feature may not be available on all devices. Please refer to the
5603  specific device data sheet to determine availability or use
5604  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5605  this feature is available.
5606 */
5607 
5608 bool
5610  USART_MODULE_ID index ) ;
5611 //******************************************************************************
5612 /* Function:
5613  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5614  Summary:
5615  Identifies if the receive data is available for the specified USART module.
5616  Description:
5617  This function identifies if the receive data is available for the specified
5618  USART module.
5619  This operation is atomic.
5620  Precondition:
5621  None.
5622  Parameters:
5623  index - Identifier for the device instance to be configured
5624  Returns:
5625  - true - The data is available
5626  - false - The data is not available
5627  Example:
5628  <code>
5629 #define MY_USART_INSTANCE USART_ID_1
5630  int8_t mydata;
5631  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5632  {
5633  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5634  }
5635  </code>
5636  Remarks:
5637  This feature may not be available on all devices. Please refer to the
5638  specific device data sheet to determine availability or use
5639  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5640  whether this feature is available.
5641 */
5642 
5643 bool
5645  USART_MODULE_ID index ) ;
5646 //******************************************************************************
5647 /* Function:
5648  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5649  Summary:
5650  Clears a USART vverrun error.
5651  Description:
5652  This function clears an overrun error. Clearing the error, resets the receive buffer.
5653  This operation is atomic.
5654  Precondition:
5655  None.
5656  Parameters:
5657  index - Identifier for the device instance to be configured
5658  Returns:
5659  None.
5660  Example:
5661  <code>
5662 #define MY_USART_INSTANCE USART_ID_1
5663  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5664  {
5665  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5666  }
5667  </code>
5668  Remarks:
5669  WARNING: Calling this API will clear all of the previously received data.
5670 
5671  This feature may not be available on all devices. Please refer to the
5672  specific device data sheet to determine availability or use
5673  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5674  whether this feature is available.
5675 */
5676 
5677 void
5679  USART_MODULE_ID index ) ;
5680 //******************************************************************************
5681 /* Function:
5682  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5683  Summary:
5684  Gets the transmit buffer full status.
5685  Description:
5686  This function gets the transmit status of the specified USART module.
5687  This operation is atomic.
5688  Precondition:
5689  None.
5690  Parameters:
5691  index - Identifier for the device instance to be configured
5692  Returns:
5693  - true - The transmit buffer is full
5694  - false - The transmit buffer is not full, at least one more
5695  character can be written
5696  Example:
5697  <code>
5698 #define MY_USART_INSTANCE USART_ID_1
5699  // Wait for the Transmit buffer to be empty.
5700  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5701  // Transmit the break character.
5702  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5703  </code>
5704  Remarks:
5705  This feature may not be available on all devices. Please refer to the
5706  specific device data sheet to determine availability or use
5707  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5708  whether this feature is available.
5709 */
5710 
5711 bool
5713  USART_MODULE_ID index ) ;
5714 //******************************************************************************
5715 /* Function:
5716  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5717  Summary:
5718  Gets the transmit shift register empty status.
5719  Description:
5720  This function gets the transmit shift register empty status.
5721  This operation is atomic.
5722  Precondition:
5723  None.
5724  Parameters:
5725  index - Identifier for the device instance to be configured
5726  Returns:
5727  - true - The transmit shift register is empty
5728  - false - The transmit shift register is not empty
5729  Example:
5730  <code>
5731 #define MY_USART_INSTANCE USART_ID_1
5732  // Wait for the Transmit buffer to be empty.
5733  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5734  // Transmit the break character.
5735  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5736  </code>
5737  Remarks:
5738  This feature may not be available on all devices. Please refer to the
5739  specific device data sheet to determine availability or use
5740  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5741  whether this feature is available.
5742 */
5743 
5744 bool
5746  USART_MODULE_ID index ) ;
5747 //******************************************************************************
5748 /* Function:
5749  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5750  Summary:
5751  Gets the framing error status.
5752  Description:
5753  This function gets the framing error status.
5754  This operation is atomic.
5755  Precondition:
5756  None.
5757  Parameters:
5758  index - Identifier for the device instance to be configured
5759  Returns:
5760  - true - The framing error was detected on the current character
5761  - false - The framing error was not detected on the current
5762  character
5763  Example:
5764  <code>
5765 #define MY_USART_INSTANCE USART_ID_1
5766  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5767  </code>
5768  Remarks:
5769  Reading the error clears the error.
5770  This feature may not be available on all devices. Please refer to the
5771  specific device data sheet to determine availability or use
5772  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5773  whether this feature is available.
5774 */
5775 
5776 bool
5778  USART_MODULE_ID index ) ;
5779 //******************************************************************************
5780 /* Function:
5781  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5782  Summary:
5783  Gets the parity error status.
5784  Description:
5785  This function gets the parity error status.
5786  This operation is atomic.
5787  Precondition:
5788  None.
5789  Parameters:
5790  index - Identifier for the device instance to be configured
5791  Returns:
5792  - true - The parity error was detected on the current character
5793  - false - The parity error was not detected on the current character
5794  Example:
5795  <code>
5796 #define MY_USART_INSTANCE USART_ID_1
5797  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5798  </code>
5799  Remarks:
5800  Reading the error clears the error.
5801  A Parity error is irrelevant in case of 9-bit mode.
5802  This feature may not be available on all devices. Please refer to the
5803  specific device data sheet to determine availability or use
5804  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5805  whether this feature is available.
5806 */
5807 
5808 bool
5810  USART_MODULE_ID index ) ;
5811 //******************************************************************************
5812 /* Function:
5813  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5814  Summary:
5815  Identifies if there was a receiver overrun error.
5816  Description:
5817  This function identifies if there was a receiver overrun error.
5818  This operation is atomic.
5819  Precondition:
5820  None.
5821  Parameters:
5822  index - Identifier for the device instance to be configured
5823  Returns:
5824  - true - The receive buffer has overflowed
5825  - false - The receive buffer has not overflowed
5826  Example:
5827  <code>
5828 #define MY_USART_INSTANCE USART_ID_1
5829  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5830  {
5831  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5832  }
5833  </code>
5834  Remarks:
5835  This feature may not be available on all devices. Please refer to the
5836  specific device data sheet to determine availability or use
5837  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5838  whether this feature is available.
5839 */
5840 
5841 bool
5843  USART_MODULE_ID index ) ;
5844 //******************************************************************************
5845 /* Function:
5846  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5847  Summary:
5848  Identifies if the receiver is idle.
5849  Description:
5850  This function identifies if the receiver is idle.
5851  This operation is atomic.
5852  Precondition:
5853  None.
5854  Parameters:
5855  index - Identifier for the device instance to be configured
5856  Returns:
5857  - true - The receive buffer is idle
5858  - false - The receive buffer is not idle
5859  Example:
5860  <code>
5861 #define MY_USART_INSTANCE USART_ID_1
5862  int8_t mydata;
5863  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5864  {
5865  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5866  }
5867  </code>
5868  Remarks:
5869  This feature may not be available on all devices. Please refer to the
5870  specific device data sheet to determine availability or use
5871  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5872  whether this feature is available.
5873 */
5874 
5875 bool
5877  USART_MODULE_ID index ) ;
5878 //******************************************************************************
5879 /* Function:
5880  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5881  Summary:
5882  Enables the USART receiver.
5883  Description:
5884  This function enables the USART receiver.
5885  This operation is atomic.
5886  Precondition:
5887  None.
5888  Parameters:
5889  index - Identifier for the device instance to be configured
5890  Returns:
5891  None.
5892  Example:
5893  <code>
5894 #define MY_USART_INSTANCE USART_ID_1
5895  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5896  </code>
5897  Remarks:
5898  This feature may not be available on all devices. Please refer to the
5899  specific device data sheet to determine availability or use
5900  PLIB_USART_ExistsReceiverEnable in your application to determine
5901  whether this feature is available.
5902 */
5903 
5904 void
5906  USART_MODULE_ID index ) ;
5907 //******************************************************************************
5908 /* Function:
5909  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5910  Summary:
5911  Disables the USART receiver.
5912  Description:
5913  This function disables the USART receiver.
5914  This operation is atomic.
5915  Precondition:
5916  None.
5917  Parameters:
5918  index - Identifier for the device instance to be configured
5919  Returns:
5920  None.
5921  Example:
5922  <code>
5923 #define MY_USART_INSTANCE USART_ID_1
5924  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5925  </code>
5926  Remarks:
5927  This feature may not be available on all devices. Please refer to the
5928  specific device data sheet to determine availability or use
5929  PLIB_USART_ExistsReceiverEnable in your application to determine
5930  whether this feature is available.
5931 */
5932 
5933 void
5935  USART_MODULE_ID index ) ;
5936 //******************************************************************************
5937 /* Function:
5938  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5939  Summary:
5940  Enables the Transmit Idle Low state.
5941  Description:
5942  This function enables the Transmit Idle Low state. In the USART Synchronous
5943  mode, this function configures that the TX polarity, the idle state is low.
5944  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5945  state to a '1'.
5946  This operation is atomic.
5947  Precondition:
5948  None.
5949  Parameters:
5950  index - Identifier for the device instance to be configured
5951  Returns:
5952  None.
5953  Example:
5954  <code>
5955 #define MY_USART_INSTANCE USART_ID_1
5956  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5957  </code>
5958  Remarks:
5959  This feature may not be available on all devices. Please refer to the
5960  specific device data sheet to determine availability or use
5961  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5962  whether this feature is available.
5963 */
5964 
5965 void
5967  USART_MODULE_ID index ) ;
5968 //******************************************************************************
5969 /* Function:
5970  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5971  Summary:
5972  Disables the Transmit Idle Low state.
5973  Description:
5974  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5975  this function configures that the TX polarity the idle state is high.
5976  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5977  state to a '0'.
5978  This operation is atomic.
5979  Precondition:
5980  None.
5981  Parameters:
5982  index - Identifier for the device instance to be configured
5983  Returns:
5984  None.
5985  Example:
5986  <code>
5987 #define MY_USART_INSTANCE USART_ID_1
5988  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5989  </code>
5990  Remarks:
5991  This feature may not be available on all devices. Please refer to the
5992  specific device data sheet to determine availability or use
5993  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5994  whether this feature is available.
5995 */
5996 
5997 void
5999  USART_MODULE_ID index ) ;
6000 //******************************************************************************
6001 /* Function:
6002  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6003  Summary:
6004  Enables receive polarity inversion.
6005  Description:
6006  This function enables receive polarity inversion. In the USART Synchronous mode,
6007  this function configures that the data is inverted.
6008  This operation is atomic.
6009  Precondition:
6010  None.
6011  Parameters:
6012  index - Identifier for the device instance to be configured
6013  Returns:
6014  None.
6015  Example:
6016  <code>
6017 #define MY_USART_INSTANCE USART_ID_1
6018  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6019  </code>
6020  Remarks:
6021  This feature may not be available on all devices. Please refer to the
6022  specific device data sheet to determine availability or use
6023  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6024  whether this feature is available.
6025 */
6026 
6027 void
6029  USART_MODULE_ID index ) ;
6030 //******************************************************************************
6031 /* Function:
6032  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6033  Summary:
6034  Disables receive polarity inversion.
6035  This operation is atomic.
6036  Description:
6037  This function disables receive polarity inversion. In the USART Synchronous
6038  mode, this function configures that the data is not inverted.
6039  Precondition:
6040  None.
6041  Parameters:
6042  index - Identifier for the device instance to be configured
6043  Returns:
6044  None.
6045  Example:
6046  <code>
6047 #define MY_USART_INSTANCE USART_ID_1
6048  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6049  </code>
6050  Remarks:
6051  This feature may not be available on all devices. Please refer to the
6052  specific device data sheet to determine availability or use
6053  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6054  whether this feature is available.
6055 */
6056 
6057 void
6059  USART_MODULE_ID index ) ;
6060 //******************************************************************************
6061 /* Function:
6062  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6063  Summary:
6064  Enables high baud rate selection.
6065  Description:
6066  This function enables high baud rate selection.
6067  This operation is atomic.
6068  Precondition:
6069  None.
6070  Parameters:
6071  index - Identifier for the device instance to be configured
6072  Returns:
6073  None.
6074  Example:
6075  <code>
6076 #define MY_USART_INSTANCE USART_ID_1
6077  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6078  </code>
6079  Remarks:
6080  This feature may not be available on all devices. Please refer to the
6081  specific device data sheet to determine availability or use
6082  PLIB_USART_ExistsBaudRateHigh in your application to determine
6083  whether this feature is available.
6084 */
6085 
6086 void
6088  USART_MODULE_ID index ) ;
6089 //******************************************************************************
6090 /* Function:
6091  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6092  Summary:
6093  Disables the high baud rate selection.
6094  Description:
6095  This function disables the high baud rate selection.
6096  This operation is atomic.
6097  Precondition:
6098  None.
6099  Parameters:
6100  index - Identifier for the device instance to be configured
6101  Returns:
6102  None.
6103  Example:
6104  <code>
6105 #define MY_USART_INSTANCE USART_ID_1
6106  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6107  </code>
6108  Remarks:
6109  This feature may not be available on all devices. Please refer to the
6110  specific device data sheet to determine availability or use
6111  PLIB_USART_ExistsBaudRateHigh in your application to determine
6112  whether this feature is available.
6113 */
6114 
6115 void
6117  USART_MODULE_ID index ) ;
6118 //******************************************************************************
6119 /* Function:
6120  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6121  USART_TRANSMIT_INTR_MODE interruptMode )
6122  Summary:
6123  Sets the USART transmitter interrupt mode.
6124  Description:
6125  This function sets the condition in which the USART module should generate
6126  an interrupt.
6127  This operation is atomic.
6128  Precondition:
6129  None.
6130  Parameters:
6131  index - Identifier for the device instance to be configured
6132  interruptMode - Interrupt mode; for possible configurations, refer to
6133  USART_TRANSMIT_INTR_MODE
6134  Returns:
6135  None.
6136  Example:
6137  <code>
6138 #define MY_USART_INSTANCE USART_ID_1
6139  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6140  USART_TRANSMIT_FIFO_EMPTY );
6141  </code>
6142  Remarks:
6143  This feature may not be available on all devices. Please refer to the
6144  specific device data sheet to determine availability or use
6145  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6146  whether this feature is available.
6147 */
6148 
6149 void
6151  USART_MODULE_ID index ,
6152  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6153 //******************************************************************************
6154 /* Function:
6155  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6156  USART_RECEIVE_INTR_MODE interruptMode )
6157  Summary:
6158  Sets the USART receiver FIFO level.
6159  Description:
6160  This function sets the USART receiver FIFO level.
6161  This operation is atomic.
6162  Precondition:
6163  None.
6164  Parameters:
6165  index - Identifier for the device instance to be configured
6166  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6167  Returns:
6168  None.
6169  Example:
6170  <code>
6171 #define MY_USART_INSTANCE USART_ID_1
6172  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6173  USART_RECEIVE_FIFO_ONE_CHAR );
6174  </code>
6175  Remarks:
6176  This feature may not be available on all devices. Please refer to the
6177  specific device data sheet to determine availability or use
6178  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6179  whether this feature is available.
6180 */
6181 
6182 void
6184  USART_MODULE_ID index ,
6185  USART_RECEIVE_INTR_MODE interruptMode ) ;
6186 //******************************************************************************
6187 /* Function:
6188  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6189  USART_LINECONTROL_MODE dataFlowConfig)
6190  Summary:
6191  Sets the data flow configuration.
6192  Description:
6193  This function sets the USART data flow configuration based on the mask
6194  provided and the specified baud rate.
6195  Precondition:
6196  None.
6197  Parameters:
6198  index - Identifier for the device instance to be configured
6199  mode - For possible data flow configurations, refer to
6200  USART_LINECONTROL_MODE
6201  Returns:
6202  None.
6203  Example:
6204  <code>
6205 #define MY_USART_INSTANCE USART_ID_1
6206  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6207  USART_8N1);
6208  </code>
6209  Remarks:
6210  This feature may not be available on all devices. Please refer to the
6211  specific device data sheet to determine availability or use
6212  PLIB_USART_ExistsLineControlMode in your application to determine
6213  whether this feature is available.
6214 */
6215 
6216 void
6218  USART_MODULE_ID index ,
6219  USART_LINECONTROL_MODE dataFlowConfig ) ;
6220 //******************************************************************************
6221 /* Function:
6222  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6223  USART_HANDSHAKE_MODE handshakeConfig)
6224  Summary:
6225  Sets the data flow configuration.
6226  Description:
6227  This function sets the USART data flow configuration based on the mask
6228  provided and the specified baud rate.
6229  Precondition:
6230  None.
6231  Parameters:
6232  index - Identifier for the device instance to be configured
6233  mode - For possible data flow configurations, refer to
6234  USART_HANDSHAKE_MODE
6235  Returns:
6236  None.
6237  Example:
6238  <code>
6239 #define MY_USART_INSTANCE USART_ID_1
6240  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6241  USART_HANDSHAKE_MODE_SIMPLEX);
6242  </code>
6243  Remarks:
6244  This feature may not be available on all devices. Please refer to the
6245  specific device data sheet to determine availability or use
6246  PLIB_USART_ExistsHandshakeMode in your application to determine
6247  whether this feature is available.
6248 */
6249 
6250 void
6252  USART_MODULE_ID index ,
6253  USART_HANDSHAKE_MODE handshakeConfig ) ;
6254 //******************************************************************************
6255 /* Function:
6256  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6257  int8_t Mask)
6258  Summary:
6259  Setup the automatic Address Detect mode.
6260  Description:
6261  This function configures the automatic Address Detect mode. Uses the mask as
6262  the address character for automatic address detection.
6263  This operation is atomic.
6264  Precondition:
6265  None.
6266  Parameters:
6267  index - Identifier for the device instance to be configured
6268  Mask - Address character to be used, when enabled
6269  Returns:
6270  None.
6271  Example:
6272  <code>
6273 #define MY_USART_INSTANCE USART_ID_1
6274  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6275  MY_DEVICE_ADDRESS);
6276  </code>
6277  Remarks:
6278  This feature may not be available on all devices. Please refer to the
6279  specific device data sheet to determine availability or use
6280  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6281  whether this feature is available.
6282 */
6283 
6284 void
6286  USART_MODULE_ID index ,
6287  int8_t Mask ) ;
6288 //******************************************************************************
6289 /* Function:
6290  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6291  USART_MODULE_ID index )
6292  Summary:
6293  Disables the automatic Address Detect mode.
6294  Description:
6295  This function disables the automatic Address Detect mode.
6296  This operation is atomic.
6297  Precondition:
6298  None.
6299  Parameters:
6300  index - Identifier for the device instance to be configured
6301  Returns:
6302  None.
6303  Example:
6304  <code>
6305 #define MY_USART_INSTANCE USART_ID_1
6306  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6307  </code>
6308  Remarks:
6309  This feature may not be available on all devices. Please refer to the
6310  specific device data sheet to determine availability or use
6311  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6312  whether this feature is available.
6313 */
6314 
6315 void
6317  USART_MODULE_ID index ) ;
6318 //******************************************************************************
6319 /* Function:
6320  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6321  Summary:
6322  Enables the IrDA encoder and decoder.
6323  Description:
6324  This function enables the IrDA encoder and decoder.
6325  This operation is atomic.
6326  Precondition:
6327  None.
6328  Parameters:
6329  index - Identifier for the device instance to be configured
6330  Returns:
6331  None.
6332  Example:
6333  <code>
6334 #define MY_USART_INSTANCE USART_ID_1
6335  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6336  </code>
6337  Remarks:
6338  This feature may not be available on all devices. Please refer to the
6339  specific device data sheet to determine availability or use
6340  PLIB_USART_ExistsIrDA in your application to determine
6341  whether this feature is available.
6342 */
6343 
6344 void
6346  USART_MODULE_ID index ) ;
6347 //******************************************************************************
6348 /* Function:
6349  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6350  Summary:
6351  Disables the IrDA encoder and decoder.
6352  Description:
6353  This function disables the IrDA encoder and decoder.
6354  This operation is atomic.
6355  Precondition:
6356  None.
6357  Parameters:
6358  index - Identifier for the device instance to be configured
6359  Returns:
6360  None.
6361  Example:
6362  <code>
6363 #define MY_USART_INSTANCE USART_ID_1
6364  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6365  </code>
6366  Remarks:
6367  By default, the IrDA Encoder and Decoder are disabled.
6368 
6369  This feature may not be available on all devices. Please refer to the
6370  specific device data sheet to determine availability or use
6371  PLIB_USART_ExistsIrDA in your application to determine
6372  whether this feature is available.
6373 */
6374 
6375 void
6377  USART_MODULE_ID index ) ;
6378 //******************************************************************************
6379 /* Function:
6380  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6381  Summary:
6382  Enables Loopback mode.
6383  Description:
6384  This function enables Loopback mode.
6385  This operation is atomic.
6386  Precondition:
6387  None.
6388  Parameters:
6389  index - Identifier for the device instance to be configured
6390  Returns:
6391  None.
6392  Example:
6393  <code>
6394 #define MY_USART_INSTANCE USART_ID_1
6395  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6396  </code>
6397  Remarks:
6398  By default, Loopback mode is disabled.
6399 
6400  This feature may not be available on all devices. Please refer to the
6401  specific device data sheet to determine availability or use
6402  PLIB_USART_ExistsLoopback in your application to determine
6403  whether this feature is available.
6404 */
6405 
6406 void
6408  USART_MODULE_ID index ) ;
6409 //******************************************************************************
6410 /* Function:
6411  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6412  Summary:
6413  Disables Loopback mode.
6414  Description:
6415  This function disables Loopback mode.
6416  This operation is atomic.
6417  Precondition:
6418  None.
6419  Parameters:
6420  index - Identifier for the device instance to be configured
6421  Returns:
6422  None.
6423  Example:
6424  <code>
6425 #define MY_USART_INSTANCE USART_ID_1
6426  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6427  </code>
6428  Remarks:
6429  By default, Loopback mode is disabled.
6430  This feature may not be available on all devices. Please refer to the
6431  specific device data sheet to determine availability or use
6432  PLIB_USART_ExistsLoopback in your application to determine
6433  whether this feature is available.
6434 */
6435 
6436 void
6438  USART_MODULE_ID index ) ;
6439 //******************************************************************************
6440 /* Function:
6441  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6442  USART_OPERATION_MODE operationmode)
6443  Summary:
6444  Configures the operation mode of the USART module.
6445  Description:
6446  This function configures the operation mode of the USART (i.e., controls the
6447  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6448  possible settings.
6449  Precondition:
6450  None.
6451  Parameters:
6452  index - Identifier for the device instance to be configured
6453  operationmode - One of the possible values from USART_OPERATION_MODE
6454  Returns:
6455  None.
6456  Example:
6457  <code>
6458 #define MY_USART_INSTANCE USART_ID_1
6459  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6460  </code>
6461  Remarks:
6462  This feature may not be available on all devices. Please refer to the
6463  specific device data sheet to determine availability or use
6464  PLIB_USART_ExistsOperationMode in your application to determine
6465  whether this feature is available.
6466 */
6467 
6468 void
6470  USART_MODULE_ID index ,
6471  USART_OPERATION_MODE operationmode ) ;
6472 //******************************************************************************
6473 /* Function:
6474  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6475  Summary:
6476  Discontinues operation when the device enters Idle mode.
6477  Description:
6478  This function enables the USART module to discontinue operation when the
6479  device enters Idle mode.
6480  This operation is atomic.
6481  Precondition:
6482  None.
6483  Parameters:
6484  index - Identifier for the device instance to be configured
6485  Returns:
6486  None.
6487  Example:
6488  <code>
6489 #define MY_USART_INSTANCE USART_ID_1
6490  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6491  </code>
6492  Remarks:
6493  This feature may not be available on all devices. Please refer to the
6494  specific device data sheet to determine availability or use
6495  PLIB_USART_ExistsStopInIdle in your application to determine
6496  whether this feature is available.
6497 */
6498 
6499 void
6501  USART_MODULE_ID index ) ;
6502 //******************************************************************************
6503 /* Function:
6504  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6505  Summary:
6506  Disables the Stop in Idle mode (the USART module continues operation when
6507  the device is in Idle mode).
6508  Description:
6509  This function disables the Stop in Idle mode. The USART module continues
6510  operation when the device is in Idle mode.
6511  This operation is atomic.
6512  Precondition:
6513  None.
6514  Parameters:
6515  index - Identifier for the device instance to be configured
6516  Returns:
6517  None.
6518  Example:
6519  <code>
6520 #define MY_USART_INSTANCE USART_ID_1
6521  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6522  </code>
6523  Remarks:
6524  By default, the USART module will continue operation in Idle mode.
6525 
6526  This feature may not be available on all devices. Please refer to the
6527  specific device data sheet to determine availability or use
6528  PLIB_USART_ExistsStopInIdle in your application to determine
6529  whether this feature is available.
6530 */
6531 
6532 void
6534  USART_MODULE_ID index ) ;
6535 //******************************************************************************
6536 /* Function:
6537  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6538  Summary:
6539  Enables the wake-up on start bit detection feature during Sleep mode.
6540  Description:
6541  This function enables the wake-up on start feature during Sleep mode.
6542  This operation is atomic.
6543  Precondition:
6544  None.
6545  Parameters:
6546  index - Identifier for the device instance to be configured
6547  Returns:
6548  None.
6549  Example:
6550  <code>
6551 #define MY_USART_INSTANCE USART_ID_1
6552  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6553  </code>
6554  Remarks:
6555  This feature may not be available on all devices. Please refer to the
6556  specific device data sheet to determine availability or use
6557  PLIB_USART_ExistsWakeOnStart in your application to determine
6558  whether this feature is available.
6559 */
6560 
6561 void
6563  USART_MODULE_ID index ) ;
6564 //******************************************************************************
6565 /* Function:
6566  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6567  Summary:
6568  Disables the wake-up on start bit detection feature during Sleep mode.
6569  Description:
6570  This function disables the wake-up on start bit detection feature during
6571  Sleep mode.
6572  This operation is atomic.
6573  Precondition:
6574  None.
6575  Parameters:
6576  index - Identifier for the device instance to be configured
6577  Returns:
6578  None.
6579  Example:
6580  <code>
6581 #define MY_USART_INSTANCE USART_ID_1
6582  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6583  </code>
6584  Remarks:
6585  This feature may not be available on all devices. Please refer to the
6586  specific device data sheet to determine availability or use
6587  PLIB_USART_ExistsWakeOnStart in your application to determine
6588  whether this feature is available.
6589 */
6590 
6591 void
6593  USART_MODULE_ID index ) ;
6594 //******************************************************************************
6595 /* Function:
6596  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6597  Summary:
6598  Gets the state of the sync break event completion.
6599  Description:
6600  This function returns the status of the sync break event, when called
6601  after enabling using PLIB_USART_WakeOnStartEnable.
6602  This operation is atomic.
6603  Precondition:
6604  None.
6605  Parameters:
6606  index - Identifier for the device instance to be configured
6607  Returns:
6608  None.
6609  Example:
6610  <code>
6611 #define MY_USART_INSTANCE USART_ID_1
6612  //Call the interface just prior to entering the sleep mode.
6613  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6614  // Check the status if the Sync break event is over.
6615  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6616  {
6617  // Do Something
6618  }
6619  </code>
6620  Remarks:
6621  This feature may not be available on all devices. Please refer to the
6622  specific device data sheet to determine availability or use
6623  PLIB_USART_ExistsWakeOnStart in your application to determine
6624  whether this feature is available.
6625 */
6626 
6627 bool
6629  USART_MODULE_ID index ) ;
6630 //******************************************************************************
6631 /* Function:
6632  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6633  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6634  Summary:
6635  Enables or disables general features of the USART module.
6636  Description:
6637  This function enables or disables general features of the USART module.
6638  Precondition:
6639  None.
6640  Parameters:
6641  index - Identifier for the device instance to be configured
6642  autobaud - If true, auto baud rate detection is enabled. If false
6643  the feature is disabled.
6644  loopBackMode - If true, loop back is enabled. If false the feature is
6645  disabled.
6646  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6647  mode on USART activity. If false the feature is disabled.
6648  irdaMode - If true, the IrDA mode is enabled. If false the feature
6649  is disabled.
6650  stopInIdle - If true, module will stop functioning when CPU enters Idle
6651  mode. If false, the feature is disabled.
6652  Returns:
6653  None.
6654  Example:
6655  <code>
6656 #define MY_USART_INSTANCE USART_ID_1
6657  // Enable loopback, disable IrDA, disable auto baud detection and disable
6658  // wake from sleep. Enable stop in idle
6659  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6660  false, false, true);
6661  </code>
6662  Remarks:
6663  Enabling the wake from sleep feature will cause the first character that is
6664  received by the USART module to be discarded. This feature should only be
6665  enabled if the CPU is to placed in power saving mode.
6666 
6667  This feature may not be available on all devices. Please refer to the
6668  specific device data sheet to determine availability. Availability of this
6669  function can also be determined if all of the following functions return
6670  true:
6671  - PLIB_USART_ExistsLoopback
6672  - PLIB_USART_ExistsBaudRateAutoDetect
6673  - PLIB_USART_ExistsWakeOnStart
6674  - PLIB_USART_ExistsIrDA
6675  - PLIB_USART_ExistsStopInIdle
6676 */
6677 
6678 void
6680  USART_MODULE_ID index ,
6681  bool autobaud ,
6682  bool loopBackMode ,
6683  bool wakeFromSleep ,
6684  bool irdaMode ,
6685  bool stopInIdle ) ;
6686 //******************************************************************************
6687 /* Function:
6688  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6689  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6690  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6691  USART_OPERATION_MODE operationMode);
6692  Summary:
6693  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6694  lines to be used by the module.
6695  Description:
6696  This function configures the Receive and Transmit FIFO interrupt levels and
6697  the hardware lines to be used by the module.
6698  Precondition:
6699  None.
6700  Parameters:
6701  index - Identifier for the device instance to be configured
6702  receiveInterruptMode - Receiver FIFO interrupt level
6703  transmitInterruptMode - Transmit FIFO interrupt level
6704  operationMode - Hardware lines to be used by the USART.
6705  Returns:
6706  None.
6707  Example:
6708  <code>
6709 #define MY_USART_INSTANCE USART_ID_1
6710  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6711  // Set Transmit FIFO to interrupt when FIFO is empty
6712  // USART module will only use RX and TX hardware lines
6713  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6714  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6715  </code>
6716  Remarks:
6717  This feature may not be available on all devices. Please refer to the
6718  specific device data sheet to determine availability. Availability of this
6719  function can also be determined if all of the following functions return
6720  true:
6721  - PLIB_USART_ExistsReceiverInterruptMode
6722  - PLIB_USART_ExistsTransmitterInterruptMode
6723  - PLIB_USART_ExistsOperationMode
6724 */
6725 
6726 void
6728  USART_MODULE_ID index ,
6729  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6730  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6731  USART_OPERATION_MODE operationMode ) ;
6732 //******************************************************************************
6733 /* Function:
6734  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6735  clockFrequency, uint32_t baudRate );
6736  Summary:
6737  Sets the baud rate to the desired value and enables the USART receiver,
6738  transmitter and the USART module.
6739  Description:
6740  This function sets the baud rate to the desired value and enables the USART
6741  receiver, USART transmitter and USART module.
6742  Precondition:
6743  None.
6744  Parameters:
6745  index - Identifier for the device instance to be configured
6746  baudRate - Baud Rate Value
6747  clockFrequency - Clock Frequency
6748  Returns:
6749  None.
6750  Example:
6751  <code>
6752 #define MY_USART_INSTANCE USART_ID_1
6753  uint32_t baudRateValue ;
6754  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6755  </code>
6756  Remarks:
6757  Setting a new baud rate value causes the baud rate timer to reset.
6758  This ensures that the baud rate timer does not have to overflow before
6759  outputting the new baud rate.
6760 
6761  If the system clock is changed during an active receive operation, a
6762  receiver error or data loss may result. To avoid this issue verify that
6763  no receptions are in progress before changing the system clock.
6764 
6765  This feature may not be available on all devices. Please refer to the
6766  specific device data sheet to determine availability. Availability of this
6767  function can also be determined if all of the following functions return
6768  true:
6769  - PLIB_USART_ExistsBaudRate
6770  - PLIB_USART_ExistsTransmitterEnable
6771  - PLIB_USART_ExistsReceiverEnable
6772  - PLIB_USART_ExistsEnable
6773 */
6774 
6775 void
6777  USART_MODULE_ID index ,
6778  uint32_t systemClock ,
6779  uint32_t baud ) ;
6780 //******************************************************************************
6781 /* Function:
6782  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6783  Summary:
6784  Return the status of all errors in the specified USART module.
6785  Description:
6786  This function returns status of all errors in the specified USART module.
6787  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6788  status of a specific error.
6789  This operation is atomic.
6790  Precondition:
6791  None.
6792  Parameters:
6793  index - Identifier for the device instance to be configured
6794  Returns:
6795  Returns a bitmap of USART error status.
6796  Example:
6797  <code>
6798 #define MY_USART_INSTANCE USART_ID_1
6799  USART_ERROR error;
6800  // Get the status of all errors.
6801  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6802  // Check if parity error is active
6803  if(error & USART_ERROR_PARITY)
6804  {
6805  // Parity error is active.
6806  }
6807  else if(error & USART_ERROR_FRAMING)
6808  {
6809  // Framing error is active.
6810  }
6811  </code>
6812  Remarks:
6813  This feature may not be available on all devices. Please refer to the
6814  specific device data sheet to determine availability. Availability of this
6815  function can also be determined if all of the followings functions return
6816  true:
6817  - PLIB_USART_ExistsReceiverFramingErrorStatus
6818  - PLIB_USART_ExistsReceiverParityErrorStatus
6819  - PLIB_USART_ExistsReceiverOverrunStatus
6820 */
6821 
6822 USART_ERROR
6824  USART_MODULE_ID index ) ;
6825 //******************************************************************************
6826 /* Function:
6827  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6828  Summary:
6829  Returns the address of the USART TX register
6830  Description:
6831  This function returns the address of the USART TX register.
6832  This operation is atomic.
6833  Preconditions:
6834  None.
6835  Parameters:
6836  index - Identifier for the device instance
6837  Returns:
6838  Address of the USART TX register
6839  Remarks:
6840  None.
6841 */
6842 
6843 void *
6845  USART_MODULE_ID index ) ;
6846 //******************************************************************************
6847 /* Function:
6848  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6849  Summary:
6850  Returns the address of the USART RX register
6851  Description:
6852  This function returns the address of the USART RX register.
6853  This operation is atomic.
6854  Preconditions:
6855  None.
6856  Parameters:
6857  index - Identifier for the device instance
6858  Returns:
6859  Address of the USART RX register
6860  Remarks:
6861  None.
6862 */
6863 
6864 void *
6866  USART_MODULE_ID index ) ;
6867 // *****************************************************************************
6868 // *****************************************************************************
6869 // Section: USART Peripheral Library Exists Functions
6870 // *****************************************************************************
6871 // *****************************************************************************
6872 /* The following functions indicate the existence of the features on the device.
6873 */
6874 //******************************************************************************
6875 /* Function:
6876  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6877  Summary:
6878  Identifies whether the Run in overflow condition feature exists on the USART module.
6879  Description:
6880  This function identifies whether the Run in Overflow condition feature is
6881  available on the USART module. When this function returns true, these
6882  functions are supported on the device:
6883  - PLIB_USART_RunInOverflowEnable
6884  - PLIB_USART_RunInOverflowDisable
6885  - PLIB_USART_RunInOverflowIsEnabled
6886  This operation is atomic.
6887  Preconditions:
6888  None.
6889  Parameters:
6890  index - Identifier for the device instance
6891  Returns:
6892  - true - The Run in Overflow condition feature is supported on the device
6893  - false - The Run in Overflow condition feature is not supported on the device
6894  Remarks:
6895  None.
6896 */
6897 
6898 bool
6900  USART_MODULE_ID index ) ;
6901 //******************************************************************************
6902 /* Function:
6903  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6904  Summary:
6905  Identifies whether the BRG Clock source select feature exists on the
6906  USART module.
6907  Description:
6908  This function identifies whether the BRG Clock source select feature is
6909  available on the USART module. When this function returns true, these
6910  functions are supported on the device:
6911  - PLIB_USART_BRGClockSourceSelect
6912  - PLIB_USART_BRGClockSourceGet
6913  This operation is atomic.
6914  Preconditions:
6915  None.
6916  Parameters:
6917  index - Identifier for the device instance
6918  Returns:
6919  - true - The BRG clock source select feature is supported on the device
6920  - false - The BRG clock source select feature is not supported on the device
6921  Remarks:
6922  None.
6923 */
6924 
6925 bool
6927  USART_MODULE_ID index ) ;
6928 //******************************************************************************
6929 /* Function:
6930  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6931  Summary:
6932  Identifies whether the module running status feature exists on the
6933  USART module.
6934  Description:
6935  This function identifies whether the module running status feature is
6936  available on the USART module. When this function returns true, this
6937  function is supported on the device:
6938  - PLIB_USART_ModuleIsBusy
6939  This operation is atomic.
6940  Preconditions:
6941  None.
6942  Parameters:
6943  index - Identifier for the device instance
6944  Returns:
6945  - true - The Module running status feature is supported on the device
6946  - false - The Module running status feature is not supported on the device
6947  Remarks:
6948  None.
6949 */
6950 
6951 bool
6953  USART_MODULE_ID index ) ;
6954 //******************************************************************************
6955 /* Function:
6956  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6957  Summary:
6958  Identifies whether the Run in Sleep mode feature exists on the USART module.
6959  Description:
6960  This function identifies whether the Run in Sleep mode feature is
6961  available on the USART module. When this function returns true, these
6962  functions are supported on the device:
6963  - PLIB_USART_RunInSleepModeEnable
6964  - PLIB_USART_RunInSleepModeDisable
6965  - PLIB_USART_RunInSleepModeIsEnabled
6966  This operation is atomic.
6967  Preconditions:
6968  None.
6969  Parameters:
6970  index - Identifier for the device instance
6971  Returns:
6972  - true - The Run in Sleep mode feature is supported on the device
6973  - false - The Run in Sleep mode feature is not supported on the device
6974  Remarks:
6975  None.
6976 */
6977 
6978 bool
6980  USART_MODULE_ID index ) ;
6981 //******************************************************************************
6982 /* Function:
6983  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6984  Summary:
6985  Identifies whether the EnableControl feature exists on the USART module.
6986  Description:
6987  This function identifies whether the EnableControl feature is
6988  available on the USART module. When this function returns true, these
6989  functions are supported on the device:
6990  - PLIB_USART_Disable
6991  - PLIB_USART_Enable
6992  This operation is atomic.
6993  Preconditions:
6994  None.
6995  Parameters:
6996  index - Identifier for the device instance
6997  Returns:
6998  - true - The EnableControl feature is supported on the device
6999  - false - The EnableControl feature is not supported on the device
7000  Remarks:
7001  None.
7002 */
7003 
7004 bool
7006  USART_MODULE_ID index ) ;
7007 //******************************************************************************
7008 /* Function:
7009  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7010  Summary:
7011  Identifies whether the HandShakeMode feature exists on the USART module.
7012  Description:
7013  This function identifies whether the HandShakeMode feature is
7014  available on the USART module. When this function returns true, this
7015  function is supported on the device:
7016  - PLIB_USART_HandshakeModeSelect
7017  This operation is atomic.
7018  Preconditions:
7019  None.
7020  Parameters:
7021  index - Identifier for the device instance
7022  Returns:
7023  - true - The HandShakeMode feature is supported on the device
7024  - false - The HandShakeMode feature is not supported on the device
7025  Remarks:
7026  None.
7027 */
7028 
7029 bool
7031  USART_MODULE_ID index ) ;
7032 //******************************************************************************
7033 /* Function:
7034  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7035  Summary:
7036  Identifies whether the IrDAControl feature exists on the USART module.
7037  Description:
7038  This function identifies whether the IrDAControl feature is
7039  available on the USART module. When this function returns true, these
7040  functions are supported on the device:
7041  - PLIB_USART_IrDADisable
7042  - PLIB_USART_IrDAEnable
7043  This operation is atomic.
7044  Preconditions:
7045  None.
7046  Parameters:
7047  index - Identifier for the device instance
7048  Returns:
7049  - true - The IrDAControl feature is supported on the device
7050  - false - The IrDAControl feature is not supported on the device
7051  Remarks:
7052  None.
7053 */
7054 
7055 bool
7057  USART_MODULE_ID index ) ;
7058 //******************************************************************************
7059 /* Function:
7060  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7061  Summary:
7062  Identifies whether the LineControlMode feature exists on the USART module.
7063  Description:
7064  This function identifies whether the LineControlMode feature is
7065  available on the USART module. When this function returns true, this
7066  function is supported on the device:
7067  - PLIB_USART_LineControlModeSelect
7068  This operation is atomic.
7069  Preconditions:
7070  None.
7071  Parameters:
7072  index - Identifier for the device instance
7073  Returns:
7074  - true - The LineControlMode feature is supported on the device
7075  - false - The LineControlMode feature is not supported on the device
7076  Remarks:
7077  None.
7078 */
7079 
7080 bool
7082  USART_MODULE_ID index ) ;
7083 //******************************************************************************
7084 /* Function:
7085  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7086  Summary:
7087  Identifies whether the Loopback feature exists on the USART module.
7088  Description:
7089  This function identifies whether the Loopback feature is
7090  available on the USART module. When this function returns true, these
7091  functions are supported on the device:
7092  - PLIB_USART_LoopbackEnable
7093  - PLIB_USART_LoopbackDisable
7094  This operation is atomic.
7095  Preconditions:
7096  None.
7097  Parameters:
7098  index - Identifier for the device instance
7099  Returns:
7100  - true - The Loopback feature is supported on the device
7101  - false - The Loopback feature is not supported on the device
7102  Remarks:
7103  None.
7104 */
7105 
7106 bool
7108  USART_MODULE_ID index ) ;
7109 //******************************************************************************
7110 /* Function:
7111  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7112  Summary:
7113  Identifies whether the OperationMode feature exists on the USART module.
7114  Description:
7115  This function identifies whether the OperationMode feature is
7116  available on the USART module. When this function returns true, this
7117  function is supported on the device:
7118  - PLIB_USART_OperationModeSelect
7119  This operation is atomic.
7120  Preconditions:
7121  None.
7122  Parameters:
7123  index - Identifier for the device instance
7124  Returns:
7125  - true - The OperationMode feature is supported on the device
7126  - false - The OperationMode feature is not supported on the device
7127  Remarks:
7128  None.
7129 */
7130 
7131 bool
7133  USART_MODULE_ID index ) ;
7134 //******************************************************************************
7135 /* Function:
7136  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7137  Summary:
7138  Identifies whether the StopInIdle feature exists on the USART module.
7139  Description:
7140  This function identifies whether the StopInIdle feature is
7141  available on the USART module. When this function returns true, these
7142  functions are supported on the device:
7143  - PLIB_USART_StopInIdleEnable
7144  - PLIB_USART_StopInIdleDisable
7145  This operation is atomic.
7146  Preconditions:
7147  None.
7148  Parameters:
7149  index - Identifier for the device instance
7150  Returns:
7151  - true - The StopInIdle feature is supported on the device
7152  - false - The StopInIdle feature is not supported on the device
7153  Remarks:
7154  None.
7155 */
7156 
7157 bool
7159  USART_MODULE_ID index ) ;
7160 //******************************************************************************
7161 /* Function:
7162  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7163  Summary:
7164  Identifies whether the WakeOnStart feature exists on the USART module.
7165  Description:
7166  This function identifies whether the WakeOnStart feature is
7167  available on the USART module. When this function returns true, these
7168  functions are supported on the device:
7169  - PLIB_USART_WakeOnStartEnable
7170  - PLIB_USART_WakeOnStartDisable
7171  - PLIB_USART_WakeOnStartIsEnabled
7172  This operation is atomic.
7173  Preconditions:
7174  None.
7175  Parameters:
7176  index - Identifier for the device instance
7177  Returns:
7178  - true - The WakeOnStart feature is supported on the device
7179  - false - The WakeOnStart feature is not supported on the device
7180  Remarks:
7181  None.
7182 */
7183 
7184 bool
7186  USART_MODULE_ID index ) ;
7187 //******************************************************************************
7188 /* Function:
7189  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7190  Summary:
7191  Identifies whether the BaudRate feature exists on the USART module.
7192  Description:
7193  This function identifies whether the BaudRate feature is
7194  available on the USART module. When this function returns true, these
7195  functions are supported on the device:
7196  - PLIB_USART_BaudRateSet
7197  - PLIB_USART_BaudRateGet
7198  This operation is atomic.
7199  Preconditions:
7200  None.
7201  Parameters:
7202  index - Identifier for the device instance
7203  Returns:
7204  - true - The BaudRate feature is supported on the device
7205  - false - The BaudRate feature is not supported on the device
7206  Remarks:
7207  None.
7208 */
7209 
7210 bool
7212  USART_MODULE_ID index ) ;
7213 //******************************************************************************
7214 /* Function:
7215  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7216  Summary:
7217  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7218  Description:
7219  This function identifies whether the BaudRateAutoDetect feature is
7220  available on the USART module. When this function returns true, these
7221  functions are supported on the device:
7222  - PLIB_USART_BaudRateAutoDetectEnable
7223  - PLIB_USART_BaudRateAutoDetectIsComplete
7224  This operation is atomic.
7225  Preconditions:
7226  None.
7227  Parameters:
7228  index - Identifier for the device instance
7229  Returns:
7230  - true - The BaudRateAutoDetect feature is supported on the device
7231  - false - The BaudRateAutoDetect feature is not supported on the device
7232  Remarks:
7233  None.
7234 */
7235 
7236 bool
7238  USART_MODULE_ID index ) ;
7239 //******************************************************************************
7240 /* Function:
7241  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7242  Summary:
7243  Identifies whether the BaudRateHigh feature exists on the USART module.
7244  Description:
7245  This function identifies whether the BaudRateHigh feature is
7246  available on the USART module. When this function returns true, these
7247  functions are supported on the device:
7248  - PLIB_USART_BaudRateHighSet
7249  - PLIB_USART_BaudRateHighDisable
7250  - PLIB_USART_BaudRateHighEnable
7251  This operation is atomic.
7252  Preconditions:
7253  None.
7254  Parameters:
7255  index - Identifier for the device instance
7256  Returns:
7257  - true - The BaudRateHigh feature is supported on the device
7258  - false - The BaudRateHigh feature is not supported on the device
7259  Remarks:
7260  None.
7261 */
7262 
7263 bool
7265  USART_MODULE_ID index ) ;
7266 //******************************************************************************
7267 /* Function:
7268  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7269  Summary:
7270  Identifies whether the Receiver Address feature exists on the USART
7271  module.
7272  Description:
7273  This function identifies whether the Receiver Address feature is
7274  available on the USART module. When this function returns true, these
7275  functions are supported on the device:
7276  - PLIB_USART_AddressSet
7277  - PLIB_USART_AddressGet
7278  This operation is atomic.
7279  Preconditions:
7280  None.
7281  Parameters:
7282  index - Identifier for the device instance
7283  Returns:
7284  - true - The Receiver address feature is supported on the device
7285  - false - The Receiver address feature is not supported on the device
7286  Remarks:
7287  None.
7288 */
7289 
7290 bool
7292  USART_MODULE_ID index ) ;
7293 //******************************************************************************
7294 /* Function:
7295  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7296  Summary:
7297  Identifies whether the Receiver Address Mask feature exists on the USART
7298  module.
7299  Description:
7300  This function identifies whether the Receiver Address Mask feature is
7301  available on the USART module. When this function returns true, these
7302  functions are supported on the device:
7303  - PLIB_USART_AddressMaskSet
7304  - PLIB_USART_AddressMaskGet
7305  This operation is atomic.
7306  Preconditions:
7307  None.
7308  Parameters:
7309  index - Identifier for the device instance
7310  Returns:
7311  - true - The Receiver address mask feature is supported on the device
7312  - false - The Receiver address mask feature is not supported on the device
7313  Remarks:
7314  None.
7315 */
7316 
7317 bool
7319  USART_MODULE_ID index ) ;
7320 //******************************************************************************
7321 /* Function:
7322  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7323  Summary:
7324  Identifies whether the Receiver feature exists on the USART module.
7325  Description:
7326  This function identifies whether the Receiver feature is available on the
7327  USART module. When this function returns true, these functions are supported
7328  on the device:
7329  - PLIB_USART_ReceiverByteReceive
7330  - PLIB_USART_ReceiverAddressGet
7331  This operation is atomic.
7332  Preconditions:
7333  None.
7334  Parameters:
7335  index - Identifier for the device instance
7336  Returns:
7337  - true - The Receiver feature is supported on the device
7338  - false - The Receiver feature is not supported on the device
7339  Remarks:
7340  None.
7341 */
7342 
7343 bool
7345  USART_MODULE_ID index ) ;
7346 //******************************************************************************
7347 /* Function:
7348  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7349  Summary:
7350  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7351  Description:
7352  This function identifies whether the 9 Bits Receiver feature is available on the
7353  USART module. When this function returns true, this function is supported
7354  on the device:
7355  - PLIB_USART_Receiver9BitsReceive
7356  This operation is atomic.
7357  Preconditions:
7358  None.
7359  Parameters:
7360  index - Identifier for the device instance
7361  Returns:
7362  - true - The feature is supported on the device
7363  - false - The feature is not supported on the device
7364  Remarks:
7365  None.
7366 */
7367 
7368 bool
7370  USART_MODULE_ID index ) ;
7371 //******************************************************************************
7372 /* Function:
7373  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7374  Summary:
7375  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7376  Description:
7377  This function identifies whether the ReceiverAddressAutoDetect feature is
7378  available on the USART module. When this function returns true, these
7379  functions are supported on the device:
7380  - PLIB_USART_ReceiverAddressAutoDetectEnable
7381  - PLIB_USART_ReceiverAddressAutoDetectDisable
7382  This operation is atomic.
7383  Preconditions:
7384  None.
7385  Parameters:
7386  index - Identifier for the device instance
7387  Returns:
7388  - true - The ReceiverAddressAutoDetect feature is supported on the device
7389  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7390  Remarks:
7391  None.
7392 */
7393 
7394 bool
7396  USART_MODULE_ID index ) ;
7397 //******************************************************************************
7398 /* Function:
7399  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7400  Summary:
7401  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7402  Description:
7403  This function identifies whether the ReceiverAddressDetect feature is
7404  available on the USART module. When this function returns true, these
7405  functions are supported on the device:
7406  - PLIB_USART_ReceiverAddressDetectEnable
7407  - PLIB_USART_ReceiverAddressDetectDisable
7408  - PLIB_USART_ReceiverAddressIsReceived
7409  This operation is atomic.
7410  Preconditions:
7411  None.
7412  Parameters:
7413  index - Identifier for the device instance
7414  Returns:
7415  - true - The ReceiverAddressDetect feature is supported on the device
7416  - false - The ReceiverAddressDetect feature is not supported on the device
7417  Remarks:
7418  None.
7419 */
7420 
7421 bool
7423  USART_MODULE_ID index ) ;
7424 //******************************************************************************
7425 /* Function:
7426  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7427  Summary:
7428  Identifies whether the ReceiverDataAvailable feature exists on the USART
7429  module
7430  Description:
7431  This function identifies whether the ReceiverDataAvailable feature is
7432  available on the USART module. When this function returns true, this
7433  function is supported on the device:
7434  - PLIB_USART_ReceiverDataIsAvailable
7435  This operation is atomic.
7436  Preconditions:
7437  None.
7438  Parameters:
7439  index - Identifier for the device instance
7440  Returns:
7441  - true - The ReceiverDataAvailable feature is supported on the device
7442  - false - The ReceiverDataAvailable feature is not supported on the device
7443  Remarks:
7444  None.
7445 */
7446 
7447 bool
7449  USART_MODULE_ID index ) ;
7450 //******************************************************************************
7451 /* Function:
7452  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7453  Summary:
7454  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7455  Description:
7456  This function identifies whether the ReceiverEnableControl feature is
7457  available on the USART module. When this function returns true, these
7458  functions are supported on the device:
7459  - PLIB_USART_ReceiverEnable
7460  - PLIB_USART_ReceiverDisable
7461  This operation is atomic.
7462  Preconditions:
7463  None.
7464  Parameters:
7465  index - Identifier for the device instance
7466  Returns:
7467  - true - The ReceiverEnableControl feature is supported on the device
7468  - false - The ReceiverEnableControl feature is not supported on the device
7469  Remarks:
7470  None.
7471 */
7472 
7473 bool
7475  USART_MODULE_ID index ) ;
7476 //******************************************************************************
7477 /* Function:
7478  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7479  Summary:
7480  Identifies whether the ReceiverIdle feature exists on the USART module.
7481  Description:
7482  This function identifies whether the ReceiverIdle feature is
7483  available on the USART module. When this function returns true, this
7484  function is supported on the device:
7485  - PLIB_USART_ReceiverIsIdle
7486  This operation is atomic.
7487  Preconditions:
7488  None.
7489  Parameters:
7490  index - Identifier for the device instance
7491  Returns:
7492  - true - The ReceiverIdle feature is supported on the device
7493  - false - The ReceiverIdle feature is not supported on the device
7494  Remarks:
7495  None.
7496 */
7497 
7498 bool
7500  USART_MODULE_ID index ) ;
7501 //******************************************************************************
7502 /* Function:
7503  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7504  Summary:
7505  Identifies whether the ReceiverFramingError feature exists on the USART module.
7506  Description:
7507  This function identifies whether the ReceiverFramingError feature is
7508  available on the USART module. When this function returns true, this
7509  function is supported on the device:
7510  - PLIB_USART_ReceiverFramingErrorHasOccurred
7511  This operation is atomic.
7512  Preconditions:
7513  None.
7514  Parameters:
7515  index - Identifier for the device instance
7516  Returns:
7517  - true - The ReceiverFramingError feature is supported on the device
7518  - false - The ReceiverFramingError feature is not supported on the device
7519  Remarks:
7520  None.
7521 */
7522 
7523 bool
7525  USART_MODULE_ID index ) ;
7526 //******************************************************************************
7527 /* Function:
7528  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7529  Summary:
7530  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7531  Description:
7532  This function identifies whether the ReceiverInterruptMode feature is
7533  available on the USART module. When this function returns true, this
7534  function is supported on the device:
7535  - PLIB_USART_ReceiverInterruptModeSelect
7536  This operation is atomic.
7537  Preconditions:
7538  None.
7539  Parameters:
7540  index - Identifier for the device instance
7541  Returns:
7542  - true - The ReceiverInterruptMode feature is supported on the device
7543  - false - The ReceiverInterruptMode feature is not supported on the device
7544  Remarks:
7545  None.
7546 */
7547 
7548 bool
7550  USART_MODULE_ID index ) ;
7551 //******************************************************************************
7552 /* Function:
7553  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7554  Summary:
7555  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7556  Description:
7557  This function identifies whether the ReceiverPolarityInvert feature is
7558  available on the USART module. When this function returns true, these
7559  functions are supported on the device:
7560  - PLIB_USART_ReceiverIdleStateLowEnable
7561  - PLIB_USART_ReceiverIdleStateLowDisable
7562  This operation is atomic.
7563  Preconditions:
7564  None.
7565  Parameters:
7566  index - Identifier for the device instance
7567  Returns:
7568  - true - The ReceiverPolarityInvert feature is supported on the device
7569  - false - The ReceiverPolarityInvert feature is not supported on the device
7570  Remarks:
7571  None.
7572 */
7573 
7574 bool
7576  USART_MODULE_ID index ) ;
7577 //******************************************************************************
7578 /* Function:
7579  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7580  Summary:
7581  Identifies whether the ReceiverParityError feature exists on the USART module.
7582  Description:
7583  This function identifies whether the ReceiverParityError feature is
7584  available on the USART module. When this function returns true, this
7585  function is supported on the device:
7586  - PLIB_USART_ReceiverParityErrorHasOccurred
7587  This operation is atomic.
7588  Preconditions:
7589  None.
7590  Parameters:
7591  index - Identifier for the device instance
7592  Returns:
7593  - true - The ReceiverParityError feature is supported on the device
7594  - false - The ReceiverParityError feature is not supported on the device
7595  Remarks:
7596  None.
7597 */
7598 
7599 bool
7601  USART_MODULE_ID index ) ;
7602 //******************************************************************************
7603 /* Function:
7604  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7605  Summary:
7606  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7607  Description:
7608  This function identifies whether the ReceiverOverrunError feature is
7609  available on the USART module. When this function returns true, these
7610  functions are supported on the device:
7611  - PLIB_USART_ReceiverOverrunErrorClear
7612  - PLIB_USART_ReceiverOverrunHasOccurred
7613  This operation is atomic.
7614  Preconditions:
7615  None.
7616  Parameters:
7617  index - Identifier for the device instance
7618  Returns:
7619  - true - The ReceiverOverrunError feature is supported on the device
7620  - false - The ReceiverOverrunError feature is not supported on the device
7621  Remarks:
7622  None.
7623 */
7624 
7625 bool
7627  USART_MODULE_ID index ) ;
7628 //******************************************************************************
7629 /* Function:
7630  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7631  Summary:
7632  Identifies whether the Transmitter feature exists on the USART module.
7633  Description:
7634  This function identifies whether the Transmitter feature is
7635  available on the USART module. When this function returns true, these
7636  functions are supported on the device:
7637  - PLIB_USART_TransmitterByteSend
7638  - PLIB_USART_TransmitterAddressGet
7639  This operation is atomic.
7640  Preconditions:
7641  None.
7642  Parameters:
7643  index - Identifier for the device instance
7644  Returns:
7645  - true - The Transmitter feature is supported on the device
7646  - false - The Transmitter feature is not supported on the device
7647  Remarks:
7648  None.
7649 */
7650 
7651 bool
7653  USART_MODULE_ID index ) ;
7654 //******************************************************************************
7655 /* Function:
7656  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7657  Summary:
7658  Identifies whether the Transmitter9Bits feature exists on the USART module.
7659  Description:
7660  This function identifies whether the Transmitter9Bits feature is
7661  available on the USART module. When this function returns true, this
7662  function is supported on the device:
7663  - PLIB_USART_Transmitter9BitsSend
7664  This operation is atomic.
7665  Preconditions:
7666  None.
7667  Parameters:
7668  index - Identifier for the device instance
7669  Returns:
7670  - true - The Transmitter9Bits feature is supported on the device
7671  - false - The Transmitter9Bits feature is not supported on the device
7672  Remarks:
7673  None.
7674 */
7675 
7676 bool
7678  USART_MODULE_ID index ) ;
7679 //******************************************************************************
7680 /* Function:
7681  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7682  Summary:
7683  Identifies whether the TransmitterBreak feature exists on the USART module.
7684  Description:
7685  This function identifies whether the TransmitterBreak feature is
7686  available on the USART module. When this function returns true, these
7687  functions are supported on the device:
7688  - PLIB_USART_TransmitterBreakSend
7689  - PLIB_USART_TransmitterBreakSendIsComplete
7690  This operation is atomic.
7691  Preconditions:
7692  None.
7693  Parameters:
7694  index - Identifier for the device instance
7695  Returns:
7696  - true - The TransmitterBreak feature is supported on the device
7697  - false - The TransmitterBreak feature is not supported on the device
7698  Remarks:
7699  None.
7700 */
7701 
7702 bool
7704  USART_MODULE_ID index ) ;
7705 //******************************************************************************
7706 /* Function:
7707  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7708  Summary:
7709  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7710  Description:
7711  This function identifies whether the TransmitterBufferFull feature is
7712  available on the USART module. When this function returns true, this
7713  function is supported on the device:
7714  - PLIB_USART_TransmitterBufferIsFull
7715  This operation is atomic.
7716  Preconditions:
7717  None.
7718  Parameters:
7719  index - Identifier for the device instance
7720  Returns:
7721  - true - The TransmitterBufferFull feature is supported on the device
7722  - false - The TransmitterBufferFull feature is not supported on the device
7723  Remarks:
7724  None.
7725 */
7726 
7727 bool
7729  USART_MODULE_ID index ) ;
7730 //******************************************************************************
7731 /* Function:
7732  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7733  Summary:
7734  Identifies whether the TransmitterEmpty feature exists on the USART module.
7735  Description:
7736  This function identifies whether the TransmitterEmpty feature is
7737  available on the USART module. When this function returns true, this
7738  function is supported on the device:
7739  - PLIB_USART_TransmitterIsEmpty
7740  This operation is atomic.
7741  Preconditions:
7742  None.
7743  Parameters:
7744  index - Identifier for the device instance
7745  Returns:
7746  - true - The TransmitterEmpty feature is supported on the device
7747  - false - The TransmitterEmpty feature is not supported on the device
7748  Remarks:
7749  None.
7750 */
7751 
7752 bool
7754  USART_MODULE_ID index ) ;
7755 //******************************************************************************
7756 /* Function:
7757  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7758  Summary:
7759  Identifies whether the TransmitterEnableControl feature exists on the USART
7760  module
7761  Description:
7762  This function identifies whether the TransmitterEnableControl feature is
7763  available on the USART module. When this function returns true, these
7764  functions are supported on the device:
7765  - PLIB_USART_TransmitterEnable
7766  - PLIB_USART_TransmitterDisable
7767  This operation is atomic.
7768  Preconditions:
7769  None.
7770  Parameters:
7771  index - Identifier for the device instance
7772  Returns:
7773  - true - The TransmitterEnableControl feature is supported on the device
7774  - false - The TransmitterEnableControl feature is not supported on the device
7775  Remarks:
7776  None.
7777 */
7778 
7779 bool
7781  USART_MODULE_ID index ) ;
7782 //******************************************************************************
7783 /* Function:
7784  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7785  Summary:
7786  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7787  Description:
7788  This function identifies whether the TransmitterInterruptMode feature is
7789  available on the USART module. When this function returns true, this function
7790  is supported on the device:
7791  - PLIB_USART_TransmitterInterruptModeSelect
7792  This operation is atomic.
7793  Preconditions:
7794  None.
7795  Parameters:
7796  index - Identifier for the device instance
7797  Returns:
7798  - true - The TransmitterInterruptMode feature is supported on the device
7799  - false - The TransmitterInterruptMode feature is not supported on the device
7800  Remarks:
7801  None.
7802 */
7803 
7804 bool
7806  USART_MODULE_ID index ) ;
7807 //******************************************************************************
7808 /* Function:
7809  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7810  Summary:
7811  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7812  Description:
7813  This function identifies whether the TransmitterIdleIsLow feature is available
7814  on the USART module. When this function returns true, these functions are
7815  supported on the device:
7816  - PLIB_USART_TransmitterIdleIsLowDisable
7817  - PLIB_USART_TransmitterIdleIsLowEnable
7818  This operation is atomic.
7819  Preconditions:
7820  None.
7821  Parameters:
7822  index - Identifier for the device instance
7823  Returns:
7824  - true - The TransmitterIdleIsLow feature is supported on the device
7825  - false - The TransmitterIdleIsLow feature is not supported on the device
7826  Remarks:
7827  None.
7828 */
7829 
7830 bool
7832  USART_MODULE_ID index ) ;
7833 //DOM-IGNORE-BEGIN
7834 //DOM-IGNORE-END
7835  // #ifndef _PLIB_USART_H
7836 /******************************************************************************
7837  End of File
7838 */
7839 
7840 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7841 /* CLOSE_FILE Include File */
7842 
7843 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7844 /*******************************************************************************
7845  System Services Library Interface Header
7846  Company:
7847  Microchip Technology Inc.
7848  File Name:
7849  system.h
7850  Summary:
7851  Top level common system services library interface header.
7852  Description:
7853  This file is the top level common system services library interface header.
7854  It defines (or includes files that define) the common system service
7855  types, prototypes, and other definitions that are commonly used by MPLAB
7856  Harmony libraries and system services.
7857 
7858  System services provide common functionality that would otherwise need to
7859  be duplicated by multiple other modules or that would force them to
7860  interact in complex and hard to manage ways. System services eliminate
7861  conflicts by controlling access shared resources.
7862  Remarks:
7863  The parent directory to the "system" directory should be added to the
7864  compiler's search path for header files such that the following include
7865  statment will successfully include this file.
7866 
7867 #include "system/system.h"
7868  *******************************************************************************/
7869 //DOM-IGNORE-BEGIN
7870 /*******************************************************************************
7871 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7872 Microchip licenses to you the right to use, modify, copy and distribute
7873 Software only when embedded on a Microchip microcontroller or digital signal
7874 controller that is integrated into your product or third party product
7875 (pursuant to the sublicense terms in the accompanying license agreement).
7876 You should refer to the license agreement accompanying this Software for
7877 additional information regarding your rights and obligations.
7878 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7879 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7880 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7881 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7882 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7883 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7884 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7885 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7886 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7887 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7888  *******************************************************************************/
7889 //DOM-IGNORE-END
7890 #ifndef _SYSTEM_H
7891 #define _SYSTEM_H
7892 // *****************************************************************************
7893 // *****************************************************************************
7894 // Section: Included Files
7895 // *****************************************************************************
7896 // *****************************************************************************
7897 #include "system/common/sys_common.h"
7898 #include "system/common/sys_module.h"
7899 // DOM-IGNORE-BEGIN
7900 // DOM-IGNORE-END
7901 //DOM-IGNORE-BEGIN
7902 //DOM-IGNORE-END
7903  // _SYSTEM_H
7904 /*******************************************************************************
7905  End of File
7906 */
7907 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7908 /* CLOSE_FILE Include File */
7909 
7910 #include "system/int/sys_int.h"
7911 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7912 /*******************************************************************************
7913  DMA System Service Library Interface Definition
7914  Company:
7915  Microchip Technology Inc.
7916  File Name:
7917  sys_dma.h
7918  Summary:
7919  DMA System Service.
7920  Description:
7921  This file contains the interface definition for the DMA System
7922  Service. It provides a way to interact with the DMA subsystem to
7923  manage the data transfer between different peripherals and/or memory
7924  without intervention from the CPU.
7925 *******************************************************************************/
7926 //DOM-IGNORE-BEGIN
7927 /*******************************************************************************
7928 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7929 Microchip licenses to you the right to use, modify, copy and distribute
7930 Software only when embedded on a Microchip microcontroller or digital signal
7931 controller that is integrated into your product or third party product
7932 (pursuant to the sublicense terms in the accompanying license agreement).
7933 You should refer to the license agreement accompanying this Software for
7934 additional information regarding your rights and obligations.
7935 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7936 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7937 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7938 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7939 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7940 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7941 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7942 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7943 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7944 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7945 *******************************************************************************/
7946 //DOM-IGNORE-END
7947 #ifndef _SYS_DMA_H
7948 #define _SYS_DMA_H
7949 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7950 /*******************************************************************************
7951  DMA System Service Library Interface Definition
7952  Company:
7953  Microchip Technology Inc.
7954  File Name:
7955  sys_dma_definitions.h
7956  Summary:
7957  DMA System Service data type definitions header.
7958  Description:
7959  This file contains data type definitions header.
7960 *******************************************************************************/
7961 //DOM-IGNORE-BEGIN
7962 /*******************************************************************************
7963 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7964 Microchip licenses to you the right to use, modify, copy and distribute
7965 Software only when embedded on a Microchip microcontroller or digital signal
7966 controller that is integrated into your product or third party product
7967 (pursuant to the sublicense terms in the accompanying license agreement).
7968 You should refer to the license agreement accompanying this Software for
7969 additional information regarding your rights and obligations.
7970 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7971 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7972 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7973 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7974 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7975 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7976 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7977 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7978 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7979 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7980 *******************************************************************************/
7981 //DOM-IGNORE-END
7982 #ifndef _SYS_DMA_DEFINITIONS_H
7983 #define _SYS_DMA_DEFINITIONS_H
7984 // *****************************************************************************
7985 // *****************************************************************************
7986 // Section: File includes
7987 // *****************************************************************************
7988 // *****************************************************************************
7989 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7990 #include "system/common/sys_common.h"
7991 #include "system/common/sys_module.h"
7992 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7993 /*******************************************************************************
7994  DMA Peripheral Library Interface Header
7995  Company:
7996  Microchip Technology Inc.
7997  File Name:
7998  plib_dma.h
7999  Summary:
8000  Defines the DMA Peripheral Library interface functions.
8001  Description:
8002  This header file contains the function prototypes and definitions of
8003  the data types and constants that make up the interface to the Direct Memory
8004  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8005  definitions in this file are for the DMA module.
8006 *******************************************************************************/
8007 // DOM-IGNORE-BEGIN
8008 /*******************************************************************************
8009 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8010 Microchip licenses to you the right to use, modify, copy and distribute
8011 Software only when embedded on a Microchip microcontroller or digital signal
8012 controller that is integrated into your product or third party product
8013 (pursuant to the sublicense terms in the accompanying license agreement).
8014 You should refer to the license agreement accompanying this Software for
8015 additional information regarding your rights and obligations.
8016 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8017 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8018 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8019 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8020 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8021 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8022 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8023 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8024 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8025 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8026 *******************************************************************************/
8027 // DOM-IGNORE-END
8028 #ifndef _PLIB_DMA_H
8029 #define _PLIB_DMA_H
8030 // DOM-IGNORE-BEGIN
8031 // DOM-IGNORE-END
8032 // *****************************************************************************
8033 // *****************************************************************************
8034 // Section: Includes
8035 // *****************************************************************************
8036 // *****************************************************************************
8037 /* See Bottom of file for implementation header include files.
8038 */
8039 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8040 //DOM-IGNORE-BEGIN
8041 /*******************************************************************************
8042 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8043 Microchip licenses to you the right to use, modify, copy and distribute
8044 Software only when embedded on a Microchip microcontroller or digital signal
8045 controller that is integrated into your product or third party product
8046 (pursuant to the sublicense terms in the accompanying license agreement).
8047 You should refer to the license agreement accompanying this Software for
8048 additional information regarding your rights and obligations.
8049 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8050 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8051 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8052 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8053 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8054 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8055 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8056 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8057 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8058 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8059  *******************************************************************************/
8060 //DOM-IGNORE-END
8061 #ifndef _PLIB_DMA_PROCESSOR_H
8062 #define _PLIB_DMA_PROCESSOR_H
8063 #error "Can't find header"
8064 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8065 /* CLOSE_FILE Include File */
8066 
8067 // *****************************************************************************
8068 // *****************************************************************************
8069 // Section: Peripheral Library Interface Functions
8070 // *****************************************************************************
8071 // *****************************************************************************
8072 // *****************************************************************************
8073 // *****************************************************************************
8074 // Section: DMA Channel Status Functions
8075 // *****************************************************************************
8076 // *****************************************************************************
8077 //******************************************************************************
8078 /* Function:
8079  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8080  DMA_CHANNEL channel )
8081  Summary:
8082  Returns the buffered data write status for the specified channel.
8083  Description:
8084  This function returns the buffered data write status for the specified channel.
8085  Precondition:
8086  None.
8087  Parameters:
8088  channel - One of the existing DMA channels listed by DMA_CHANNEL
8089  Returns:
8090  - true - The content of the DMA buffer has not been written to the location
8091  specified in the destination/source address or in Null Write mode
8092  - false - The content of the DMA buffer has been written to the location
8093  specified in the destination/source address or in Null Write mode
8094  Example:
8095  <code>
8096  bool chBuffWriteStatus;
8097  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8098  DMA_CHANNEL_3 );
8099  </code>
8100  Remarks:
8101  This feature is not available on all devices. Please refer to the specific device
8102  data sheet to determine availability.
8103 */
8104 
8105 bool
8107  DMA_MODULE_ID index ,
8108  DMA_CHANNEL channel ) ;
8109 /*******************************************************************************
8110  Function:
8111  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8112  DMA_CHANNEL channel,
8113  DMA_CHANNEL_COLLISION collisonType )
8114  Summary:
8115  Returns the status of the specified collision type for the specified channel.
8116  Description:
8117  This function returns the status of the specified collision type for the
8118  specified channel.
8119  Precondition:
8120  None.
8121  Parameters:
8122  channel - One of the existing DMA channels listed by DMA_CHANNEL
8123  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8124  Returns:
8125  - true - A collision specified by collisonType was detected
8126  - false - No collision of type collisonType was detected
8127  Example:
8128  <code>
8129  bool memWriteCollisionStatus;
8130  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8131  DMA_ID_0,
8132  DMA_CHANNEL_3,
8133  DMA_CHANNEL_COLLISION_MEMORY );
8134  </code>
8135  Remarks:
8136  This feature is not available on all devices. Please refer to the specific
8137  device data sheet to determine availability.
8138 */
8139 
8140 bool
8142  DMA_MODULE_ID index ,
8143  DMA_CHANNEL channel ,
8144  DMA_CHANNEL_COLLISION collisonType ) ;
8145 //******************************************************************************
8146 /* Function:
8147  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8148  DMA_CHANNEL channel )
8149  Summary:
8150  Returns the Ping-Pong mode status for the specified channel.
8151  Description:
8152  This function returns the Ping-Pong mode status for the specified channel.
8153  Precondition:
8154  None.
8155  Parameters:
8156  channel - One of the existing DMA channels listed by DMA_CHANNEL
8157  Returns:
8158  mode - One of the possible Ping-Pong modes
8159  Example:
8160  <code>
8161  DMA_PING_PONG_MODE chPingPongStatus;
8162  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8163  DMA_CHANNEL_3 );
8164  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8165  {
8166  \\Application
8167  }
8168  </code>
8169  Remarks:
8170  This feature is not available on all devices. Please refer to the specific
8171  device data sheet to determine availability.
8172 */
8173 
8174 DMA_PING_PONG_MODE
8176  DMA_MODULE_ID index ,
8177  DMA_CHANNEL channel ) ;
8178 //******************************************************************************
8179 /* Function:
8180  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8181  DMA_CHANNEL channel )
8182  Summary:
8183  Returns the event status on the specified channel.
8184  Description:
8185  This function returns the event status on the specified channel.
8186  Precondition:
8187  None.
8188  Parameters:
8189  channel - One of the possible DMA channels listed by DMA_CHANNEL
8190  Returns:
8191  - true - An event was detected
8192  - false - No events were detected
8193  Example:
8194  <code>
8195  bool channeleventStatus;
8196  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8197  DMA_CHANNEL_2 );
8198  </code>
8199  Remarks:
8200  This function implements an operation of the ChannelXEvent feature.
8201  This feature may not be available on all devices. Please refer to the
8202  specific device data sheet to determine availability or include the
8203  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8204  whether this feature is available.
8205 */
8206 
8207 bool
8209  DMA_MODULE_ID index ,
8210  DMA_CHANNEL channel ) ;
8211 // *****************************************************************************
8212 // *****************************************************************************
8213 // Section: DMA Channel Configuration Functions
8214 // *****************************************************************************
8215 // *****************************************************************************
8216 //******************************************************************************
8217 /* Function:
8218  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8219  DMA_CHANNEL channel,
8220  DMA_CHANNEL_PRIORITY channelPriority )
8221  Summary:
8222  Sets the priority of the specified channel.
8223  Description:
8224  This function sets the priority of the specified channel.
8225  Precondition:
8226  None.
8227  Parameters:
8228  channel - One of the existing DMA channels listed by DMA_CHANNEL
8229  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8230  Returns:
8231  None.
8232  Example:
8233  <code>
8234  DMA_CHANNEL channel = DMA_CHANNEL_0;
8235  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8236  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8237  </code>
8238  Remarks:
8239  This function implements an operation of the ChannelXPriority feature.
8240  This feature may not be available on all devices. Please refer to the
8241  specific device data sheet to determine availability or use the
8242  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8243  whether this feature is available.
8244 */
8245 
8246 void
8248  DMA_MODULE_ID index ,
8249  DMA_CHANNEL channel ,
8250  DMA_CHANNEL_PRIORITY channelPriority ) ;
8251 //******************************************************************************
8252 /* Function:
8253  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8254  DMA_CHANNEL channel )
8255  Summary:
8256  Gets the priority of the specified channel.
8257  Description:
8258  This function gets the priority of the specified channel.
8259  Precondition:
8260  None.
8261  Parameters:
8262  channel - One of the existing DMA channels listed by DMA_CHANNEL
8263  Returns:
8264  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8265  Example:
8266  <code>
8267  DMA_CHANNEL channel = DMA_CHANNEL_0;
8268  DMA_CHANNEL_PRIORITY channelPriority;
8269  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8270  </code>
8271  Remarks:
8272  This function implements an operation of the ChannelXPriority feature.
8273  This feature may not be available on all devices. Please refer to the
8274  specific device data sheet to determine availability or use the
8275  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8276  whether this feature is available.
8277 */
8278 
8279 DMA_CHANNEL_PRIORITY
8281  DMA_MODULE_ID index ,
8282  DMA_CHANNEL channel ) ;
8283 //******************************************************************************
8284 /* Function:
8285  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8286  DMA_CHANNEL_PRIORITY channelPriority )
8287  Summary:
8288  Sets the priority scheme of the DMA channels.
8289  Description:
8290  This function sets the priority scheme of the DMA channels at the global level.
8291  This function is used in devices that do not have the per channel priority feature.
8292  Precondition:
8293  None.
8294  Parameters:
8295  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8296  Returns:
8297  None.
8298  Example:
8299  <code>
8300  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8301  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8302  </code>
8303  Remarks:
8304  This feature is not available on all devices. Please refer to the specific
8305  device data sheet to determine availability.
8306 */
8307 
8308 void
8310  DMA_MODULE_ID index ,
8311  DMA_CHANNEL_PRIORITY channelPriority ) ;
8312 //******************************************************************************
8313 /* Function:
8314  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8315  Summary:
8316  Gets the priority scheme of the DMA channels.
8317  Description:
8318  This function gets the priority scheme of the DMA channels at the global level.
8319  This function is used in devices that do not have the per channel priority feature.
8320  Precondition:
8321  None.
8322  Parameters:
8323  None.
8324  Returns:
8325  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8326  Example:
8327  <code>
8328  DMA_CHANNEL_PRIORITY channelPriority;
8329  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8330  </code>
8331  Remarks:
8332  This feature is not available on all devices. Please refer to the specific
8333  device data sheet to determine availability.
8334 */
8335 
8336 DMA_CHANNEL_PRIORITY
8338  DMA_MODULE_ID index ) ;
8339 //******************************************************************************
8340 /* Function:
8341  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8342  DMA_CHANNEL channel )
8343  Summary:
8344  Channel is continuously enabled.
8345  Description:
8346  This function enables the channel continuously. The channel is not automatically
8347  disabled after a block transfer is complete.
8348  Precondition:
8349  None.
8350  Parameters:
8351  channel - One of the possible DMA channels listed by DMA_CHANNEL
8352  Returns:
8353  None.
8354  Example:
8355  <code>
8356  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8357  </code>
8358  Remarks:
8359  This function implements an operation of the ChannelXAuto feature.
8360  This feature may not be available on all devices. Please refer to the
8361  specific device data sheet to determine availability or use the
8362  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8363  whether this feature is available.
8364 */
8365 
8366 void
8368  DMA_MODULE_ID index ,
8369  DMA_CHANNEL channel ) ;
8370 //******************************************************************************
8371 /* Function:
8372  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8373  DMA_CHANNEL channel )
8374  Summary:
8375  Returns the channel automatic enable status.
8376  Description:
8377  This function returns the channel automatic enable status.
8378  Precondition:
8379  None.
8380  Parameters:
8381  channel - One of the possible DMA channels listed by DMA_CHANNEL
8382  Returns:
8383  - true - Channel automatic enable is on
8384  - false - Channel automatic enable is off
8385  Example:
8386  <code>
8387  bool ChAutoEnableStatus;
8388  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8389  </code>
8390  Remarks:
8391  This function implements an operation of the ChannelXAuto feature.
8392  This feature may not be available on all devices. Please refer to the
8393  specific device data sheet to determine availability or use the
8394  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8395  whether this feature is available.
8396 */
8397 
8398 bool
8400  DMA_MODULE_ID index ,
8401  DMA_CHANNEL channel ) ;
8402 //******************************************************************************
8403 /* Function:
8404  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8405  DMA_CHANNEL channel )
8406  Summary:
8407  Channel is disabled after a block transfer is complete.
8408  Description:
8409  This function disables a channel after a block transfer is complete.
8410  Precondition:
8411  None.
8412  Parameters:
8413  channel - One of the possible DMA channels listed by DMA_CHANNEL
8414  Returns:
8415  None.
8416  Example:
8417  <code>
8418  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8419  </code>
8420  Remarks:
8421  This function implements an operation of the ChannelXAuto feature.
8422  This feature may not be available on all devices. Please refer to the
8423  specific device data sheet to determine availability or use the
8424  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8425  whether this feature is available.
8426 */
8427 
8428 void
8430  DMA_MODULE_ID index ,
8431  DMA_CHANNEL channel ) ;
8432 //******************************************************************************
8433 /* Function:
8434  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8435  DMA_CHANNEL channel )
8436  Summary:
8437  Channel chain feature is enabled.
8438  Description:
8439  This function enables the channel chain feature.
8440  Precondition:
8441  None.
8442  Parameters:
8443  channel - One of the possible DMA channels listed by DMA_CHANNEL
8444  Returns:
8445  None.
8446  Example:
8447  <code>
8448  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8449  </code>
8450  Remarks:
8451  This function implements an operation of the ChannelXChainEnbl feature.
8452  This feature may not be available on all devices. Please refer to the
8453  specific device data sheet to determine availability or use the
8454  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8455  whether this feature is available.
8456 */
8457 
8458 void
8460  DMA_MODULE_ID index ,
8461  DMA_CHANNEL channel ) ;
8462 //******************************************************************************
8463 /* Function:
8464  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8465  DMA_CHANNEL channel )
8466  Summary:
8467  Returns the chain status of the specified channel.
8468  Description:
8469  This function returns the chain status of the specified channel.
8470  Precondition:
8471  None.
8472  Parameters:
8473  channel - One of the possible DMA channels listed by DMA_CHANNEL
8474  Returns:
8475  - true - The channel chain is on for this channel
8476  - false - The channel chain is off for this channel
8477  Example:
8478  <code>
8479  bool ChchainStatus;
8480  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8481  </code>
8482  Remarks:
8483  This function implements an operation of the ChannelXChainEnbl feature.
8484  This feature may not be available on all devices. Please refer to the
8485  specific device data sheet to determine availability or use the
8486  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8487  whether this feature is available.
8488 */
8489 
8490 bool
8492  DMA_MODULE_ID index ,
8493  DMA_CHANNEL channel ) ;
8494 //******************************************************************************
8495 /* Function:
8496  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8497  DMA_CHANNEL channel )
8498  Summary:
8499  Disables the channel chaining for the specified DMA channel.
8500  Description:
8501  This function disables the channel chaining for the specified DMA channel.
8502  Precondition:
8503  None.
8504  Parameters:
8505  channel - One of the possible DMA channels listed by DMA_CHANNEL
8506  Returns:
8507  None.
8508  Example:
8509  <code>
8510  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8511  </code>
8512  Remarks:
8513  This function implements an operation of the ChannelXChainEnbl feature.
8514  This feature may not be available on all devices. Please refer to the
8515  specific device data sheet to determine availability or use the
8516  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8517  whether this feature is available.
8518 */
8519 
8520 void
8522  DMA_MODULE_ID index ,
8523  DMA_CHANNEL channel ) ;
8524 //******************************************************************************
8525 /* Function:
8526  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8527  DMA_CHANNEL channel )
8528  Summary:
8529  Channel start/abort events will be registered even if the channel is
8530  disabled.
8531  Description:
8532  This function will allow the channel register start/abort events even if the
8533  channel is disabled.
8534  Precondition:
8535  None.
8536  Parameters:
8537  channel - One of the possible DMA channels listed by DMA_CHANNEL
8538  Returns:
8539  None.
8540  Example:
8541  <code>
8542  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8543  </code>
8544  Remarks:
8545  This function implements an operation of the ChannelXDisabled feature.
8546  This feature may not be available on all devices. Please refer to the
8547  specific device data sheet to determine availability or use the
8548  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8549  determine whether this feature is available.
8550 */
8551 
8552 void
8554  DMA_MODULE_ID index ,
8555  DMA_CHANNEL channel ) ;
8556 //******************************************************************************
8557 /* Function:
8558  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8559  DMA_CHANNEL channel )
8560  Summary:
8561  Channel start/abort events will be ignored even if the channel is
8562  disabled.
8563  Description:
8564  This function will allow the channel start/abort events to be ignored even if
8565  the channel is disabled.
8566  Precondition:
8567  None.
8568  Parameters:
8569  channel - One of the possible DMA channels listed by DMA_CHANNEL
8570  Returns:
8571  None.
8572  Example:
8573  <code>
8574  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8575  </code>
8576  Remarks:
8577  This function implements an operation of the ChannelXDisabled feature.
8578  This feature may not be available on all devices. Please refer to the
8579  specific device data sheet to determine availability or use the
8580  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8581  determine whether this feature is available.
8582 */
8583 
8584 void
8586  DMA_MODULE_ID index ,
8587  DMA_CHANNEL channel ) ;
8588 //******************************************************************************
8589 /* Function:
8590  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8591  DMA_CHANNEL channel )
8592  Summary:
8593  Enable the specified channel.
8594  Description:
8595  This function will enable the specified channel.
8596  Precondition:
8597  None.
8598  Parameters:
8599  channel - One of the possible DMA channels listed by DMA_CHANNEL
8600  Returns:
8601  None.
8602  Example:
8603  <code>
8604  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8605  </code>
8606  Remarks:
8607  This function implements an operation of the ChannelX feature.
8608  This feature may not be available on all devices. Please refer to the
8609  specific device data sheet to determine availability or use the
8610  PLIB_DMA_ExistsChannelX function in your application to automatically
8611  determine whether this feature is available.
8612 */
8613 
8614 void
8616  DMA_MODULE_ID index ,
8617  DMA_CHANNEL channel ) ;
8618 //******************************************************************************
8619 /* Function:
8620  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8621  DMA_CHANNEL channel )
8622  Summary:
8623  Return the enable status of the specified channel.
8624  Description:
8625  This function will return the enable status of the specified channel.
8626  Precondition:
8627  None.
8628  Parameters:
8629  channel - One of the possible DMA channels listed by DMA_CHANNEL
8630  Returns:
8631  - true - The specified DMA channel is enabled
8632  - false - The specified DMA channel is disabled
8633  Example:
8634  <code>
8635  bool chEnableStatus;
8636  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8637  </code>
8638  Remarks:
8639  This function implements an operation of the ChannelX feature.
8640  This feature may not be available on all devices. Please refer to the
8641  specific device data sheet to determine availability or use the
8642  PLIB_DMA_ExistsChannelX function in your application to automatically
8643  determine whether this feature is available.
8644 */
8645 
8646 bool
8648  DMA_MODULE_ID index ,
8649  DMA_CHANNEL channel ) ;
8650 //******************************************************************************
8651 /* Function:
8652  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8653  DMA_CHANNEL channel )
8654  Summary:
8655  Disable the specified channel.
8656  Description:
8657  This function will disable the specified channel.
8658  Precondition:
8659  None.
8660  Parameters:
8661  channel - One of the possible DMA channels listed by DMA_CHANNEL
8662  Returns:
8663  None.
8664  Example:
8665  <code>
8666  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8667  </code>
8668  Remarks:
8669  This function implements an operation of the ChannelX feature.
8670  This feature may not be available on all devices. Please refer to the
8671  specific device data sheet to determine availability or use the
8672  PLIB_DMA_ExistsChannelX function in your application to automatically
8673  determine whether this feature is available.
8674 */
8675 
8676 void
8678  DMA_MODULE_ID index ,
8679  DMA_CHANNEL channel ) ;
8680 //******************************************************************************
8681 /* Function:
8682  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8683  DMA_CHANNEL channel )
8684  Summary:
8685  Chains the specified channel to a channel lower in natural priority.
8686  Description:
8687  This function will chain the specified channel to a channel lower in
8688  natural priority. CH3 will be enabled by a CH4 transfer complete.
8689  Precondition:
8690  None.
8691  Parameters:
8692  channel - One of the possible DMA channels listed by DMA_CHANNEL
8693  Returns:
8694  None.
8695  Example:
8696  <code>
8697  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8698  </code>
8699  Remarks:
8700  This function implements an operation of the ChannelXChain feature.
8701  This feature may not be available on all devices. Please refer to the
8702  specific device data sheet to determine availability or use the
8703  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8704  determine whether this feature is available.
8705 */
8706 
8707 void
8709  DMA_MODULE_ID index ,
8710  DMA_CHANNEL channel ) ;
8711 //******************************************************************************
8712 /* Function:
8713  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8714  DMA_CHANNEL channel )
8715  Summary:
8716  Chains the specified channel to a channel higher in natural priority.
8717  Description:
8718  This function will chain the specified channel to a channel higher in
8719  natural priority. CH5 will be enabled by a CH4 transfer complete.
8720  Precondition:
8721  None.
8722  Parameters:
8723  channel - One of the possible DMA channels listed by DMA_CHANNEL
8724  Returns:
8725  None.
8726  Example:
8727  <code>
8728  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8729  </code>
8730  Remarks:
8731  This function implements an operation of the ChannelXChain feature.
8732  This feature may not be available on all devices. Please refer to the
8733  specific device data sheet to determine availability or use the
8734  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8735  determine whether this feature is available.
8736 */
8737 
8738 void
8740  DMA_MODULE_ID index ,
8741  DMA_CHANNEL channel ) ;
8742 //******************************************************************************
8743 /* Function:
8744  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8745  DMA_CHANNEL channel )
8746  Summary:
8747  Sets the Busy bit to active.
8748  Description:
8749  This function sets the Busy bit to active, indicating the channel is active
8750  or has been enabled.
8751  Precondition:
8752  None.
8753  Parameters:
8754  channel - One of the possible DMA channels listed by DMA_CHANNEL
8755  Returns:
8756  None.
8757  Example:
8758  <code>
8759  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8760  </code>
8761  Remarks:
8762  This function implements an operation of the ChannelXBusy feature.
8763  This feature may not be available on all devices. Please refer to the
8764  specific device data sheet to determine availability or use the
8765  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8766  determine whether this feature is available.
8767 */
8768 
8769 void
8771  DMA_MODULE_ID index ,
8772  DMA_CHANNEL channel ) ;
8773 //******************************************************************************
8774 /* Function:
8775  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8776  DMA_CHANNEL channel )
8777  Summary:
8778  Sets the Busy bit to inactive.
8779  Description:
8780  This function sets the Busy bit to inactive, indicating the channel is inactive
8781  or has been disabled.
8782  Precondition:
8783  None.
8784  Parameters:
8785  channel - One of the possible DMA channels listed by DMA_CHANNEL
8786  Returns:
8787  None.
8788  Example:
8789  <code>
8790  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8791  </code>
8792  Remarks:
8793  This function implements an operation of the ChannelXBusy feature.
8794  This feature may not be available on all devices. Please refer to the
8795  specific device data sheet to determine availability or use the
8796  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8797  determine whether this feature is available.
8798 */
8799 
8800 void
8802  DMA_MODULE_ID index ,
8803  DMA_CHANNEL channel ) ;
8804 //******************************************************************************
8805 /* Function:
8806  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8807  DMA_CHANNEL channel )
8808  Summary:
8809  Returns the busy status of the specified channel.
8810  Description:
8811  This function returns the busy status of the specified channel.
8812  Precondition:
8813  None.
8814  Parameters:
8815  channel - One of the possible DMA channels listed by DMA_CHANNEL
8816  Returns:
8817  - true - The channel is active or has been enabled
8818  - false - The channel is inactive or has been disabled
8819  Example:
8820  <code>
8821  bool chBusyStatus;
8822  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8823  </code>
8824  Remarks:
8825  This function implements an operation of the ChannelXBusy feature.
8826  This feature may not be available on all devices. Please refer to the
8827  specific device data sheet to determine availability or use the
8828  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8829  determine whether this feature is available.
8830 */
8831 
8832 bool
8834  DMA_MODULE_ID index ,
8835  DMA_CHANNEL channel ) ;
8836 //******************************************************************************
8837 /* Function:
8838  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8839  DMA_CHANNEL channel,
8840  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8841  Summary:
8842  Selects the data transfer direction of the specified channel.
8843  Description:
8844  This function selects the data transfer direction of the specified channel.
8845  Precondition:
8846  None.
8847  Parameters:
8848  channel - One of the possible DMA channels listed by DMA_CHANNEL
8849  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8850  Returns:
8851  None.
8852  Example:
8853  <code>
8854  PLIB_DMA_ChannelXTransferDirectionSelect (
8855  DMA_ID_0,
8856  DMA_CHANNEL_4,
8857  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8858  </code>
8859  Remarks:
8860  This feature is not available on all devices. Please refer to the specific
8861  device data sheet to determine availability.
8862 */
8863 
8864 void
8866  DMA_MODULE_ID index ,
8867  DMA_CHANNEL channel ,
8868  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8869 //******************************************************************************
8870 /* Function:
8871  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8872  DMA_MODULE_ID index,
8873  DMA_CHANNEL channel)
8874  Summary:
8875  Returns the data transfer direction of the specified channel.
8876  Description:
8877  This function returns the data transfer direction of the specified channel.
8878  Precondition:
8879  None.
8880  Parameters:
8881  channel - One of the possible DMA channels listed by DMA_CHANNEL
8882  Returns:
8883  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8884  DMA_CHANNEL_TRANSFER_DIRECTION
8885  Example:
8886  <code>
8887  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8888  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8889  DMA_ID_0,
8890  DMA_CHANNEL_4 );
8891  </code>
8892  Remarks:
8893  This feature is not available on all devices. Please refer to the specific
8894  device data sheet to determine availability.
8895 */
8896 
8897 DMA_CHANNEL_TRANSFER_DIRECTION
8899  DMA_MODULE_ID index ,
8900  DMA_CHANNEL channel ) ;
8901 //******************************************************************************
8902 /* Function:
8903  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8904  DMA_CHANNEL channel ,
8905  uint16_t address,
8906  DMA_ADDRESS_OFFSET_TYPE offset )
8907  Summary:
8908  Sets the primary/secondary start address (DPSRAM) offset to the value
8909  specified depending on the offset type specified for the specified channel.
8910  Description:
8911  This function sets the primary/secondary start address (DPSRAM) offset to the value
8912  specified depending on the offset type specified for the specified channel.
8913  Precondition:
8914  None.
8915  Parameters:
8916  channel - One of the possible DMA channels listed by DMA_CHANNEL
8917  address - The primary/secondary DPSRAM start address offset
8918  offset - The type of the address offset (primary/secondary)
8919  Returns:
8920  None.
8921  Example:
8922  <code>
8923  uint16_t address = 0x100;
8924  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8925  DMA_CHANNEL_4,
8926  address,
8927  DMA_ADDRESS_OFFSET_PRIMARY );
8928  </code>
8929  Remarks:
8930  This feature is not available on all devices. Please refer to the specific
8931  device data sheet to determine availability.
8932 */
8933 
8934 void
8936  DMA_MODULE_ID index ,
8937  DMA_CHANNEL channel ,
8938  uint16_t address ,
8939  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8940 //******************************************************************************
8941 /* Function:
8942  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8943  DMA_CHANNEL channel,
8944  DMA_ADDRESS_OFFSET_TYPE offset)
8945  Summary:
8946  Gets the primary/secondary start address (DPSRAM) offset.
8947  Description:
8948  This function gets the primary/secondary start address (DPSRAM) offset.
8949  Precondition:
8950  None.
8951  Parameters:
8952  channel - One of the possible DMA channels listed by DMA_CHANNEL
8953  offset - The type of the address offset (primary/secondary)
8954  Returns:
8955  - uint16_t - The primary/secondary DPSRAM start address offset
8956  Example:
8957  <code>
8958  uint16_t addressOffsetA;
8959  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8960  DMA_ID_0,
8961  DMA_CHANNEL_4,
8962  address,
8963  DMA_ADDRESS_OFFSET_PRIMARY );
8964  </code>
8965  Remarks:
8966  This feature is not available on all devices. Please refer to the specific
8967  device data sheet to determine availability.
8968 */
8969 
8970 uint16_t
8972  DMA_MODULE_ID index ,
8973  DMA_CHANNEL channel ,
8974  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8975 //******************************************************************************
8976 /* Function:
8977  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8978  DMA_CHANNEL channel ,
8979  uint16_t peripheraladdress )
8980  Summary:
8981  Sets the peripheral address for the specified channel.
8982  Description:
8983  This function sets the peripheral address for the specified channel.
8984  Precondition:
8985  None.
8986  Parameters:
8987  channel - One of the possible DMA channels listed by DMA_CHANNEL
8988  peripheraladdress - The peripheral address for the specified channel
8989  Returns:
8990  None.
8991  Example:
8992  <code>
8993  uint16_t peripheraladdress = 0x100;
8994  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
8995  DMA_CHANNEL_4,
8996  peripheraladdress );
8997  </code>
8998  Remarks:
8999  This feature is not available on all devices. Please refer to the specific
9000  device data sheet to determine availability.
9001 */
9002 
9003 void
9005  DMA_MODULE_ID index ,
9006  DMA_CHANNEL channel ,
9007  uint16_t peripheraladdress ) ;
9008 //******************************************************************************
9009 /* Function:
9010  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9011  DMA_CHANNEL channel )
9012  Summary:
9013  Gets the peripheral address configured for the specified channel.
9014  Description:
9015  This function gets the peripheral address configured for the specified channel.
9016  Precondition:
9017  None.
9018  Parameters:
9019  channel - One of the possible DMA channels listed by DMA_CHANNEL
9020  Returns:
9021  - uint16_t - The peripheral address configured for the specified channel
9022  Example:
9023  <code>
9024  uint16_t peripheraladdress;
9025  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9026  DMA_CHANNEL_4 );
9027  </code>
9028  Remarks:
9029  This feature is not available on all devices. Please refer to the specific
9030  device data sheet to determine availability.
9031 */
9032 
9033 uint16_t
9035  DMA_MODULE_ID index ,
9036  DMA_CHANNEL channel ) ;
9037 //******************************************************************************
9038 /* Function:
9039  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9040  DMA_CHANNEL channel ,
9041  uint16_t transferCount )
9042  Summary:
9043  Sets the DMA data transfer count for the specified channel.
9044  Description:
9045  This function sets the DMA data transfer count for the specified channel.
9046  Precondition:
9047  None.
9048  Parameters:
9049  channel - One of the possible DMA channels listed by DMA_CHANNEL
9050  transferCount - The DMA transfer count for the channel
9051  Returns:
9052  None.
9053  Example:
9054  <code>
9055  uint16_t transferCount = 0x10;
9056  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9057  DMA_CHANNEL_4,
9058  transferCount );
9059  </code>
9060  Remarks:
9061  This feature is not available on all devices. Please refer to the specific
9062  device data sheet to determine availability.
9063 */
9064 
9065 void
9067  DMA_MODULE_ID index ,
9068  DMA_CHANNEL channel ,
9069  uint16_t transferCount ) ;
9070 //******************************************************************************
9071 /* Function:
9072  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9073  DMA_CHANNEL channel )
9074  Summary:
9075  Gets the DMA data transfer count that is programmed for the specified channel.
9076  Description:
9077  This function gets the DMA data transfer count that is programmed for the specified channel.
9078  Precondition:
9079  None.
9080  Parameters:
9081  channel - One of the possible DMA channels listed by DMA_CHANNEL
9082  Returns:
9083  - uint16_t - The DMA transfer count for the channel
9084  Example:
9085  <code>
9086  uint16_t transferCount;
9087  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9088  DMA_CHANNEL_4 );
9089  </code>
9090  Remarks:
9091  This feature is not available on all devices. Please refer to the specific
9092  device data sheet to determine availability.
9093 */
9094 
9095 uint16_t
9097  DMA_MODULE_ID index ,
9098  DMA_CHANNEL channel ) ;
9099 //******************************************************************************
9100 /* Function:
9101  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9102  DMA_MODULE_ID index,
9103  DMA_CHANNEL channel,
9104  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9105  Summary:
9106  Sets the source address mode of the specified channel.
9107  Description:
9108  This function sets the source address mode of the specified channel.
9109  Precondition:
9110  None.
9111  Parameters:
9112  channel - One of the possible DMA channels listed by DMA_CHANNEL
9113  sourceAddressMode - One of the possible source addressing modes listed by
9114  DMA_SOURCE_ADDRESSING_MODE
9115  Returns:
9116  None.
9117  Example:
9118  <code>
9119  PLIB_DMA_ChannelXSourceAddressModeSelect (
9120  DMA_ID_0,
9121  DMA_CHANNEL_4,
9122  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9123  </code>
9124  Remarks:
9125  This feature is not available on all devices. Please refer to the specific
9126  device data sheet to determine availability.
9127 */
9128 
9129 void
9131  DMA_MODULE_ID index ,
9132  DMA_CHANNEL channel ,
9133  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9134 //******************************************************************************
9135 /* Function:
9136  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9137  DMA_MODULE_ID index,
9138  DMA_CHANNEL channel )
9139  Summary:
9140  Gets the source address mode of the specified channel.
9141  Description:
9142  This function gets the source address mode of the specified channel.
9143  Precondition:
9144  None.
9145  Parameters:
9146  channel - One of the possible DMA channels listed by DMA_CHANNEL
9147  Returns:
9148  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9149  listed by DMA_SOURCE_ADDRESSING_MODE
9150  Example:
9151  <code>
9152  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9153  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9154  DMA_CHANNEL_4 );
9155  </code>
9156  Remarks:
9157  This feature is not available on all devices. Please refer to the specific
9158  device data sheet to determine availability.
9159 */
9160 
9161 DMA_SOURCE_ADDRESSING_MODE
9163  DMA_MODULE_ID index ,
9164  DMA_CHANNEL channel ) ;
9165 //******************************************************************************
9166 /* Function:
9167  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9168  DMA_MODULE_ID index,
9169  DMA_CHANNEL channel,
9170  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9171  Summary:
9172  Sets the source address mode of the specified channel.
9173  Description:
9174  This function Sets the source address mode of the specified channel.
9175  Precondition:
9176  None.
9177  Parameters:
9178  channel - One of the possible DMA channels listed by DMA_CHANNEL
9179  destinationAddressMode - One of the possible source addressing modes listed by
9180  DMA_DESTINATION_ADDRESSING_MODE
9181  Returns:
9182  None.
9183  Example:
9184  <code>
9185  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9186  DMA_ID_0,
9187  DMA_CHANNEL_4,
9188  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9189  </code>
9190  Remarks:
9191  This feature is not available on all devices. Please refer to the specific
9192  device data sheet to determine availability.
9193 */
9194 
9195 void
9197  DMA_MODULE_ID index ,
9198  DMA_CHANNEL channel ,
9199  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9200 //******************************************************************************
9201 /* Function:
9202  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9203  DMA_MODULE_ID index,
9204  DMA_CHANNEL channel )
9205  Summary:
9206  Gets the source address mode of the specified channel.
9207  Description:
9208  This function gets the source address mode of the specified channel.
9209  Precondition:
9210  None.
9211  Parameters:
9212  channel - One of the possible DMA channels listed by DMA_CHANNEL
9213  Returns:
9214  - destinationAddressMode - One of the possible source addressing modes listed by
9215  DMA_DESTINATION_ADDRESSING_MODE
9216  Example:
9217  <code>
9218  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9219  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9220  DMA_ID_0,
9221  DMA_CHANNEL_4 );
9222  </code>
9223  Remarks:
9224  This feature is not available on all devices. Please refer to the specific
9225  device data sheet to determine availability.
9226 */
9227 
9228 DMA_DESTINATION_ADDRESSING_MODE
9230  DMA_MODULE_ID index ,
9231  DMA_CHANNEL channel ) ;
9232 //******************************************************************************
9233 /* Function:
9234  void PLIB_DMA_ChannelXAddressModeSelect (
9235  DMA_MODULE_ID index,
9236  DMA_CHANNEL channel,
9237  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9238  Summary:
9239  Sets the channel address mode.
9240  Description:
9241  This function sets the channel address mode.
9242  Precondition:
9243  None.
9244  Parameters:
9245  channel - One of the possible DMA channels listed by DMA_CHANNEL
9246  channelAddressMode - One of the possible channel addressing modes listed by
9247  DMA_CHANNEL_ADDRESSING_MODE
9248  Returns:
9249  None.
9250  Example:
9251  <code>
9252  PLIB_DMA_ChannelXAddressModeSelect (
9253  DMA_ID_0,
9254  DMA_CHANNEL_4,
9255  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9256  </code>
9257  Remarks:
9258  This feature is not available on all devices. Please refer to the specific
9259  device data sheet to determine availability.
9260 */
9261 
9262 void
9264  DMA_MODULE_ID index ,
9265  DMA_CHANNEL channel ,
9266  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9267 //******************************************************************************
9268 /* Function:
9269  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9270  DMA_MODULE_ID index,
9271  DMA_CHANNEL channel )
9272  Summary:
9273  Gets the channel address mode.
9274  Description:
9275  This function gets the channel address mode.
9276  Precondition:
9277  None.
9278  Parameters:
9279  channel - One of the possible DMA channels listed by DMA_CHANNEL
9280  Returns:
9281  - channelAddressMode - One of the possible source addressing modes listed by
9282  DMA_CHANNEL_ADDRESSING_MODE
9283  Example:
9284  <code>
9285  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9286  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9287  DMA_CHANNEL_4 );
9288  </code>
9289  Remarks:
9290  This feature is not available on all devices. Please refer to the specific
9291  device data sheet to determine availability.
9292 */
9293 
9294 DMA_CHANNEL_ADDRESSING_MODE
9296  DMA_MODULE_ID index ,
9297  DMA_CHANNEL channel ) ;
9298 // *****************************************************************************
9299 // *****************************************************************************
9300 // Section: DMA Channel Event Configuration functions
9301 // *****************************************************************************
9302 // *****************************************************************************
9303 //******************************************************************************
9304 /* Function:
9305  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9306  DMA_CHANNEL channel,
9307  DMA_CHANNEL_TRIGGER_TYPE trigger )
9308  Summary:
9309  Enables the specified DMA channel trigger.
9310  Description:
9311  This function enables the specified DMA channel trigger.
9312  Precondition:
9313  None.
9314  Parameters:
9315  channel - One of the possible DMA channels listed by DMA_CHANNEL
9316  trigger - Type of trigger (transfer start/abort/pattern match abort)
9317  Returns:
9318  None.
9319  Example:
9320  <code>
9321  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9322  DMA_CHANNEL_4,
9323  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9324  </code>
9325  Remarks:
9326  This function implements an operation of the ChannelXTrigger feature.
9327  This feature may not be available on all devices. Please refer to the
9328  specific device data sheet to determine availability or use the
9329  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9330  determine whether this feature is available.
9331 */
9332 
9333 void
9335  DMA_MODULE_ID index ,
9336  DMA_CHANNEL channel ,
9337  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9338 //******************************************************************************
9339 /* Function:
9340  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9341  DMA_CHANNEL channel,
9342  DMA_CHANNEL_TRIGGER_TYPE trigger )
9343  Summary:
9344  Returns the enable status of the specified DMA transfer/abort trigger.
9345  Description:
9346  This function returns the enable status of the specified DMA transfer/abort trigger.
9347  Precondition:
9348  None.
9349  Parameters:
9350  channel - One of the possible DMA channels listed by DMA_CHANNEL
9351  trigger - Type of trigger (transfer start/abort/pattern match abort)
9352  Returns:
9353  - true - The specified trigger is enabled
9354  - false - The specified trigger is disabled
9355  Example:
9356  <code>
9357  bool startTriggerstatus;
9358  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9359  DMA_ID_0,
9360  DMA_CHANNEL_4,
9361  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9362  </code>
9363  Remarks:
9364  This function implements an operation of the ChannelXTrigger feature.
9365  This feature may not be available on all devices. Please refer to the
9366  specific device data sheet to determine availability or use the
9367  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9368  determine whether this feature is available.
9369 */
9370 
9371 bool
9373  DMA_MODULE_ID index ,
9374  DMA_CHANNEL channel ,
9375  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9376 //******************************************************************************
9377 /* Function:
9378  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9379  DMA_CHANNEL channel,
9380  DMA_CHANNEL_TRIGGER_TYPE trigger )
9381  Summary:
9382  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9383  Description:
9384  This function disables the DMA transfer abort via a matching interrupt
9385  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9386  a transfer.
9387  Precondition:
9388  None.
9389  Parameters:
9390  channel - One of the possible DMA channels listed by DMA_CHANNEL
9391  trigger - Type of trigger (transfer start/abort/pattern match abort)
9392  Returns:
9393  None.
9394  Example:
9395  <code>
9396  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9397  DMA_CHANNEL_4,
9398  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9399  </code>
9400  Remarks:
9401  This function implements an operation of the ChannelXTrigger feature.
9402  This feature may not be available on all devices. Please refer to the
9403  specific device data sheet to determine availability or use the
9404  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9405  determine whether this feature is available.
9406 */
9407 
9408 void
9410  DMA_MODULE_ID index ,
9411  DMA_CHANNEL channel ,
9412  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9413 //******************************************************************************
9414 /* Function:
9415  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9416  DMA_CHANNEL channel)
9417  Summary:
9418  Gets the source number for the DMA channel interrupts.
9419  Description:
9420  This function returns the interrupt source number for the specified
9421  DMA channel.
9422  Precondition:
9423  None.
9424  Parameters:
9425  channel - One of the possible DMA channels listed by DMA_CHANNEL
9426  Returns:
9427  None.
9428  Example:
9429  <code>
9430  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9431  DMA_CHANNEL_4);
9432  </code>
9433  Remarks:
9434  This function implements an operation of the ChannelXTrigger feature.
9435  This feature may not be available on all devices. Please refer to the
9436  specific device data sheet to determine availability or use the
9437  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9438  determine whether this feature is available.
9439 */
9440 
9441 DMA_CHANNEL_INT_SOURCE
9443  DMA_MODULE_ID index ,
9444  DMA_CHANNEL channel ) ;
9445 //******************************************************************************
9446 /* Function:
9447  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9448  DMA_CHANNEL channel,
9449  DMA_TRIGGER_SOURCE IRQnum )
9450  Summary:
9451  Sets the IRQ to initiate the DMA transfer on the specified channel.
9452  Description:
9453  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9454  (IRQ to start the channel transfer.)
9455  Precondition:
9456  None.
9457  Parameters:
9458  channel - One of the possible DMA channels listed by DMA_CHANNEL
9459  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9460  Returns:
9461  None.
9462  Example:
9463  <code>
9464  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9465  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9466  DMA_CHANNEL_4,
9467  irq );
9468  </code>
9469  Remarks:
9470  This function implements an operation of the ChannelXStartIRQ feature.
9471  This feature may not be available on all devices. Please refer to the
9472  specific device data sheet to determine availability or use the
9473  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9474  determine whether this feature is available.
9475 */
9476 
9477 void
9479  DMA_MODULE_ID index ,
9480  DMA_CHANNEL channel ,
9481  DMA_TRIGGER_SOURCE IRQnum ) ;
9482 //******************************************************************************
9483 /* Function:
9484  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9485  DMA_CHANNEL channel,
9486  DMA_TRIGGER_SOURCE IRQ )
9487  Summary:
9488  Sets the IRQ to abort the DMA transfer on the specified channel.
9489  Description:
9490  This function sets the IRQ to abort the DMA transfer on the specified channel.
9491  (IRQ to start the channel transfer.)
9492  Precondition:
9493  None.
9494  Parameters:
9495  channel - One of the possible DMA channels listed by DMA_CHANNEL
9496  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9497  Returns:
9498  None.
9499  Example:
9500  <code>
9501  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9502  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9503  DMA_CHANNEL_4,
9504  irq );
9505  </code>
9506  Remarks:
9507  This function implements an operation of the ChannelXAbortIRQ feature.
9508  This feature may not be available on all devices. Please refer to the
9509  specific device data sheet to determine availability or use the
9510  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9511  determine whether this feature is available.
9512 */
9513 
9514 void
9516  DMA_MODULE_ID index ,
9517  DMA_CHANNEL channel ,
9518  DMA_TRIGGER_SOURCE IRQ ) ;
9519 //******************************************************************************
9520 /* Function:
9521  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9522  DMA_CHANNEL channel,
9523  DMA_CHANNEL_DATA_SIZE channelDataSize )
9524  Summary:
9525  Selects the data size for the specified channel.
9526  Description:
9527  This function selects the data size for the specified channel.
9528  Precondition:
9529  None.
9530  Parameters:
9531  channel - One of the possible DMA channels listed by DMA_CHANNEL
9532  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9533  Returns:
9534  None.
9535  Example:
9536  <code>
9537  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9538  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9539  DMA_CHANNEL_4,
9540  channelDataSize );
9541  </code>
9542  Remarks:
9543  This feature is not available on all devices. Please refer to the specific
9544  device data sheet to determine availability.
9545 */
9546 
9547 void
9549  DMA_MODULE_ID index ,
9550  DMA_CHANNEL channel ,
9551  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9552 //******************************************************************************
9553 /* Function:
9554  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9555  DMA_CHANNEL channel )
9556  Summary:
9557  Returns the current data size for the specified channel.
9558  Description:
9559  This function returns the current data size for the specified channel.
9560  Precondition:
9561  None.
9562  Parameters:
9563  channel - One of the possible DMA channels listed by DMA_CHANNEL
9564  Returns:
9565  - channelDataSize - One of the possible data sizes listed by
9566  DMA_CHANNEL_DATA_SIZE
9567  Example:
9568  <code>
9569  DMA_CHANNEL_DATA_SIZE channelDataSize;
9570  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9571  DMA_CHANNEL_4 );
9572  </code>
9573  Remarks:
9574  This feature is not available on all devices. Please refer to the specific
9575  device data sheet to determine availability.
9576 */
9577 
9578 DMA_CHANNEL_DATA_SIZE
9580  DMA_MODULE_ID index ,
9581  DMA_CHANNEL channel ) ;
9582 //******************************************************************************
9583 /* Function:
9584  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9585  DMA_MODULE_ID index,
9586  DMA_CHANNEL channel,
9587  DMA_TRANSFER_MODE channeltransferMode )
9588  Summary:
9589  Selects the transfer/operating mode for the specified channel.
9590  Description:
9591  This function selects the transfer/operating mode for the specified channel.
9592  (Transfer mode and operating mode are used interchangeably.)
9593  Precondition:
9594  None.
9595  Parameters:
9596  channel - One of the possible DMA channels listed by DMA_CHANNEL
9597  channeltransferMode - One of the possible operating/transfer modes listed by
9598  DMA_TRANSFER_MODE
9599  Returns:
9600  None.
9601  Example:
9602  <code>
9603  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9604  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9605  DMA_CHANNEL_4,
9606  channeltransferMode );
9607  </code>
9608  Remarks:
9609  This feature is not available on all devices. Please refer to the specific
9610  device data sheet to determine availability.
9611 */
9612 
9613 void
9615  DMA_MODULE_ID index ,
9616  DMA_CHANNEL channel ,
9617  DMA_TRANSFER_MODE channeltransferMode ) ;
9618 //******************************************************************************
9619 /* Function:
9620  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9621  DMA_MODULE_ID index,
9622  DMA_CHANNEL channel )
9623  Summary:
9624  Returns the current transfer/operating mode for the specified channel.
9625  Description:
9626  This function returns the current transfer/operating mode for the specified channel.
9627  (Transfer mode and operating mode are used interchangeably.)
9628  Precondition:
9629  None.
9630  Parameters:
9631  channel - One of the possible DMA channels listed by DMA_CHANNEL
9632  Returns:
9633  - channeltransferMode - One of the possible operating/transfer modes listed
9634  by DMA_TRANSFER_MODE
9635  Example:
9636  <code>
9637  DMA_TRANSFER_MODE channeltransferMode;
9638  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9639  DMA_ID_0,
9640  DMA_CHANNEL_4 );
9641  </code>
9642  Remarks:
9643  This feature is not available on all devices. Please refer to the specific
9644  device data sheet to determine availability.
9645 */
9646 
9647 DMA_TRANSFER_MODE
9649  DMA_MODULE_ID index ,
9650  DMA_CHANNEL channel ) ;
9651 //******************************************************************************
9652 /* Function:
9653  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9654  DMA_CHANNEL channel )
9655  Summary:
9656  Enables reloading of the address and count registers.
9657  Description:
9658  This function enables reloading of the address and count registers. The source,
9659  destination address, and the DMA count registers are reloaded to their previous
9660  values upon the start of the next operation.
9661  Precondition:
9662  None.
9663  Parameters:
9664  channel - One of the possible DMA channels listed by DMA_CHANNEL
9665  Returns:
9666  None.
9667  Example:
9668  <code>
9669  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9670  DMA_CHANNEL_4 );
9671  </code>
9672  Remarks:
9673  This feature is not available on all devices. Please refer to the specific
9674  device data sheet to determine availability.
9675 */
9676 
9677 void
9679  DMA_MODULE_ID index ,
9680  DMA_CHANNEL channel ) ;
9681 //******************************************************************************
9682 /* Function:
9683  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9684  DMA_CHANNEL channel )
9685  Summary:
9686  Returns the address and count registers reload enable status.
9687  Description:
9688  This function returns the address and count registers reload enable status.
9689  Precondition:
9690  None.
9691  Parameters:
9692  channel - One of the possible DMA channels listed by DMA_CHANNEL
9693  Returns:
9694  - true - The address and count registers reload is enabled
9695  - false - The address and count registers reload is disabled
9696  Example:
9697  <code>
9698  bool chAddressCountReloadStatus;
9699  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9700  DMA_ID_0,
9701  DMA_CHANNEL_4 );
9702  </code>
9703  Remarks:
9704  This feature is not available on all devices. Please refer to the specific
9705  device data sheet to determine availability.
9706 */
9707 
9708 bool
9710  DMA_MODULE_ID index ,
9711  DMA_CHANNEL channel ) ;
9712 //******************************************************************************
9713 /* Function:
9714  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9715  DMA_CHANNEL channel )
9716  Summary:
9717  Disables reloading of the address and count registers.
9718  Description:
9719  This function disables reloading of the address and count registers. The source, destination
9720  address, and the DMA count registers are not reloaded to their previous values upon
9721  the start of the next operation.
9722  Precondition:
9723  None.
9724  Parameters:
9725  channel - One of the possible DMA channels listed by DMA_CHANNEL
9726  Returns:
9727  None.
9728  Example:
9729  <code>
9730  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9731  DMA_CHANNEL_4 );
9732  </code>
9733  Remarks:
9734  This feature is not available on all devices. Please refer to the specific
9735  device data sheet to determine availability.
9736 */
9737 
9738 void
9740  DMA_MODULE_ID index ,
9741  DMA_CHANNEL channel ) ;
9742 //******************************************************************************
9743 /* Function:
9744  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9745  DMA_CHANNEL channel )
9746  Summary:
9747  Enables the Null Write mode.
9748  Description:
9749  This function enables the Null Write mode. A dummy write is initiated to the
9750  source address for every write to the destination address.
9751  Precondition:
9752  None.
9753  Parameters:
9754  channel - One of the possible DMA channels listed by DMA_CHANNEL
9755  Returns:
9756  None.
9757  Example:
9758  <code>
9759  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9760  DMA_CHANNEL_4 );
9761  </code>
9762  Remarks:
9763  This feature is not available on all devices. Please refer to the specific
9764  device data sheet to determine availability.
9765 */
9766 
9767 void
9769  DMA_MODULE_ID index ,
9770  DMA_CHANNEL channel ) ;
9771 //******************************************************************************
9772 /* Function:
9773  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9774  DMA_CHANNEL channel )
9775  Summary:
9776  Returns the enable status of the Null Write mode for the specified channel.
9777  Description:
9778  This function returns the enable status of the Null Write mode for the specified channel.
9779  Precondition:
9780  None.
9781  Parameters:
9782  channel - One of the possible DMA channels listed by DMA_CHANNEL
9783  Returns:
9784  - true - Null write mode is enabled for this channel
9785  - false - Null write mode is disabled for this channel
9786  Example:
9787  <code>
9788  bool chNullWriteStatus;
9789  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9790  DMA_ID_0,
9791  DMA_CHANNEL_4 );
9792  </code>
9793  Remarks:
9794  This feature is not available on all devices. Please refer to the specific
9795  device data sheet to determine availability.
9796 */
9797 
9798 bool
9800  DMA_MODULE_ID index ,
9801  DMA_CHANNEL channel ) ;
9802 //******************************************************************************
9803 /* Function:
9804  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9805  DMA_CHANNEL channel )
9806  Summary:
9807  Disables the Null Write mode.
9808  Description:
9809  This function disables the Null Write mode. No dummy write is initiated.
9810  Precondition:
9811  None.
9812  Parameters:
9813  channel - One of the possible DMA channels listed by DMA_CHANNEL
9814  Returns:
9815  None.
9816  Example:
9817  <code>
9818  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9819  DMA_CHANNEL_4 );
9820  </code>
9821  Remarks:
9822  This feature is not available on all devices. Please refer to the specific
9823  device data sheet to determine availability.
9824 */
9825 
9826 void
9828  DMA_MODULE_ID index ,
9829  DMA_CHANNEL channel ) ;
9830 // *****************************************************************************
9831 // *****************************************************************************
9832 // Section: DMA start/end functions
9833 // *****************************************************************************
9834 // *****************************************************************************
9835 //******************************************************************************
9836 /* Function:
9837  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9838  DMA_CHANNEL channel )
9839  Summary:
9840  Initiates transfer on the specified channel.
9841  Description:
9842  This function initiates transfer on the specified channel. This is a forced transfer
9843  controlled via software.
9844  Precondition:
9845  None.
9846  Parameters:
9847  channel - One of the possible DMA channels listed by DMA_CHANNEL
9848  Returns:
9849  None.
9850  Example:
9851  <code>
9852  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9853  DMA_CHANNEL_4 );
9854  </code>
9855  Remarks:
9856  This function implements an operation of the StartTransfer feature.
9857  This feature may not be available on all devices. Please refer to the
9858  specific device data sheet to determine availability or use the
9859  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9860  determine whether this feature is available.
9861 */
9862 
9863 void
9865  DMA_MODULE_ID index ,
9866  DMA_CHANNEL channel ) ;
9867 //******************************************************************************
9868 /* Function:
9869  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9870  DMA_CHANNEL channel )
9871  Summary:
9872  Aborts transfer on the specified channel.
9873  Description:
9874  This function aborts transfer on the specified channel. This is a forced abort
9875  controlled via software.
9876  Precondition:
9877  None.
9878  Parameters:
9879  channel - One of the possible DMA channels listed by DMA_CHANNEL
9880  Returns:
9881  None.
9882  Example:
9883  <code>
9884  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9885  DMA_CHANNEL_4 );
9886  </code>
9887  Remarks:
9888  This function implements an operation of the AbortTransfer feature.
9889  This feature may not be available on all devices. Please refer to the
9890  specific device data sheet to determine availability or use the
9891  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9892  determine whether this feature is available.
9893 */
9894 
9895 void
9897  DMA_MODULE_ID index ,
9898  DMA_CHANNEL channel ) ;
9899 // *****************************************************************************
9900 // *****************************************************************************
9901 // Section: DMA General Configuration functions
9902 // *****************************************************************************
9903 // *****************************************************************************
9904 //******************************************************************************
9905 /* Function:
9906  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9907  Summary:
9908  Sets the BUSY bit of the DMA controller.
9909  Description:
9910  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9911  Precondition:
9912  None.
9913  Parameters:
9914  None.
9915  Returns:
9916  None.
9917  Example:
9918  <code>
9919  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9920  </code>
9921  Remarks:
9922  This function implements an operation of the Busy feature.
9923  This feature may not be available on all devices. Please refer to the
9924  specific device data sheet to determine availability or use the
9925  PLIB_DMA_ExistsBusy function in your application to automatically
9926  determine whether this feature is available.
9927 */
9928 
9929 void
9931  DMA_MODULE_ID index ) ;
9932 //******************************************************************************
9933 /* Function:
9934  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9935  Summary:
9936  Resets the BUSY bit of the DMA controller.
9937  Description:
9938  This function resets the BUSY bit of the DMA controller. The DMA module is
9939  disabled and is not actively transferring data.
9940  Precondition:
9941  None.
9942  Parameters:
9943  None.
9944  Returns:
9945  None.
9946  Example:
9947  <code>
9948  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9949  </code>
9950  Remarks:
9951  This function implements an operation of the Busy feature.
9952  This feature may not be available on all devices. Please refer to the
9953  specific device data sheet to determine availability or use the
9954  PLIB_DMA_ExistsBusy function in your application to automatically
9955  determine whether this feature is available.
9956 */
9957 
9958 void
9960  DMA_MODULE_ID index ) ;
9961 //******************************************************************************
9962 /* Function:
9963  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9964  Summary:
9965  Gets the BUSY bit of the DMA controller.
9966  Description:
9967  This function gets the BUSY bit of the DMA controller.
9968  Precondition:
9969  None.
9970  Parameters:
9971  None.
9972  Returns:
9973  - true - DMA module is active
9974  - false - DMA module is disabled and is not actively transferring data
9975  Example:
9976  <code>
9977  bool dmaBusyStatus;
9978  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9979  </code>
9980  Remarks:
9981  This function implements an operation of the Busy feature.
9982  This feature may not be available on all devices. Please refer to the
9983  specific device data sheet to determine availability or use the
9984  PLIB_DMA_ExistsBusy function in your application to automatically
9985  determine whether this feature is available.
9986 */
9987 
9988 bool
9989  PLIB_DMA_IsBusy (
9990  DMA_MODULE_ID index ) ;
9991 //******************************************************************************
9992 /* Function:
9993  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9994  Summary:
9995  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
9996  Description:
9997  This function suspends the DMA transfers to allow uninterrupted access
9998  by the CPU to the data bus.
9999  Precondition:
10000  None.
10001  Parameters:
10002  None.
10003  Returns:
10004  None.
10005  Example:
10006  <code>
10007  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10008  </code>
10009  Remarks:
10010  This function implements an operation of the Suspend feature.
10011  This feature may not be available on all devices. Please refer to the
10012  specific device data sheet to determine availability or use the
10013  PLIB_DMA_ExistsSuspend function in your application to automatically
10014  determine whether this feature is available.
10015 */
10016 
10017 void
10019  DMA_MODULE_ID index ) ;
10020 //******************************************************************************
10021 /* Function:
10022  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10023  Summary:
10024  DMA suspend is disabled and the DMA module operates normally.
10025  Description:
10026  This function disables the DMA suspend. The DMA module continues to operate
10027  normally.
10028  Precondition:
10029  None.
10030  Parameters:
10031  None.
10032  Returns:
10033  None.
10034  Example:
10035  <code>
10036  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10037  </code>
10038  Remarks:
10039  This function implements an operation of the Suspend feature.
10040  This feature may not be available on all devices. Please refer to the
10041  specific device data sheet to determine availability or use the
10042  PLIB_DMA_ExistsSuspend function in your application to automatically
10043  determine whether this feature is available.
10044 */
10045 
10046 void
10048  DMA_MODULE_ID index ) ;
10049 //******************************************************************************
10050 /* Function:
10051  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10052  Summary:
10053  Returns the DMA suspend status.
10054  Description:
10055  This function returns the DMA suspend status.
10056  Precondition:
10057  None.
10058  Parameters:
10059  None.
10060  Returns:
10061  - true - The DMA transfers are suspended
10062  - false - The DMA operates normally
10063  Example:
10064  <code>
10065  bool dmaSuspendStatus;
10066  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10067  </code>
10068  Remarks:
10069  This function implements an operation of the Suspend feature.
10070  This feature may not be available on all devices. Please refer to the
10071  specific device data sheet to determine availability or use the
10072  PLIB_DMA_ExistsSuspend function in your application to automatically
10073  determine whether this feature is available.
10074 */
10075 
10076 bool
10078  DMA_MODULE_ID index ) ;
10079 //******************************************************************************
10080 /* Function:
10081  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10082  Summary:
10083  DMA transfers are halted during Idle mode.
10084  Description:
10085  This function halts DMA transfers during Idle mode.
10086  Precondition:
10087  None.
10088  Parameters:
10089  None.
10090  Returns:
10091  None.
10092  Example:
10093  <code>
10094  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10095  </code>
10096  Remarks:
10097  This function implements an operation of the StopInIdle feature.
10098  This feature may not be available on all devices. Please refer to the
10099  specific device data sheet to determine availability or use the
10100  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10101  determine whether this feature is available.
10102 */
10103 
10104 void
10106  DMA_MODULE_ID index ) ;
10107 //******************************************************************************
10108 /* Function:
10109  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10110  Summary:
10111  DMA transfers continue during Idle mode.
10112  Description:
10113  This function causes DMA transfers to continue during Idle mode.
10114  Precondition:
10115  None.
10116  Parameters:
10117  None.
10118  Returns:
10119  None.
10120  Example:
10121  <code>
10122  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10123  </code>
10124  Remarks:
10125  This function implements an operation of the StopInIdle feature.
10126  This feature may not be available on all devices. Please refer to the
10127  specific device data sheet to determine availability or use the
10128  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10129  determine whether this feature is available.
10130 */
10131 
10132 void
10134  DMA_MODULE_ID index ) ;
10135 //******************************************************************************
10136 /* Function:
10137  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10138  Summary:
10139  DMA module is enabled.
10140  Description:
10141  This function enables the DMA module.
10142  Precondition:
10143  None.
10144  Parameters:
10145  None.
10146  Returns:
10147  None.
10148  Example:
10149  <code>
10150  PLIB_DMA_Enable( DMA_ID_0 );
10151  </code>
10152  Remarks:
10153  This function implements an operation of the EnableControl feature.
10154  This feature may not be available on all devices. Please refer to the
10155  specific device data sheet to determine availability or use the
10156  PLIB_DMA_ExistsEnableControl function in your application to automatically
10157  determine whether this feature is available.
10158 */
10159 
10160 void
10161  PLIB_DMA_Enable (
10162  DMA_MODULE_ID index ) ;
10163 //******************************************************************************
10164 /* Function:
10165  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10166  Summary:
10167  Returns the DMA module enable status.
10168  Description:
10169  This function returns the DMA module enable status.
10170  Precondition:
10171  None.
10172  Parameters:
10173  None.
10174  Returns:
10175  - true - The DMA is enabled
10176  - false - The DMA is disabled
10177  Example:
10178  <code>
10179  PLIB_DMA_IsEnabled( DMA_ID_0 );
10180  </code>
10181  Remarks:
10182  This function implements an operation of the EnableControl feature.
10183  This feature may not be available on all devices. Please refer to the
10184  specific device data sheet to determine availability or use the
10185  PLIB_DMA_ExistsEnableControl function in your application to automatically
10186  determine whether this feature is available.
10187 */
10188 
10189 bool
10191  DMA_MODULE_ID index ) ;
10192 //******************************************************************************
10193 /* Function:
10194  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10195  Summary:
10196  DMA module is disabled.
10197  Description:
10198  This function disables the DMA module.
10199  Precondition:
10200  None.
10201  Parameters:
10202  None.
10203  Returns:
10204  None.
10205  Example:
10206  <code>
10207  PLIB_DMA_Disable( DMA_ID_0 );
10208  </code>
10209  Remarks:
10210  This function implements an operation of the EnableControl feature.
10211  This feature may not be available on all devices. Please refer to the
10212  specific device data sheet to determine availability or use the
10213  PLIB_DMA_ExistsEnableControl function in your application to automatically
10214  determine whether this feature is available.
10215 */
10216 
10217 void
10219  DMA_MODULE_ID index ) ;
10220 // *****************************************************************************
10221 // *****************************************************************************
10222 // Section: DMA status functions
10223 // *****************************************************************************
10224 // *****************************************************************************
10225 //******************************************************************************
10226 /* Function:
10227  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10228  Summary:
10229  Returns the DMA channel bits.
10230  Description:
10231  This function returns the channel bits.
10232  Precondition:
10233  None.
10234  Parameters:
10235  None.
10236  Returns:
10237  - uint8_t - DMA channel bits
10238  Example:
10239  <code>
10240  uint8_t dmaChBits;
10241  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10242  </code>
10243  Remarks:
10244  This function implements an operation of the ChannelBits feature.
10245  This feature may not be available on all devices. Please refer to the
10246  specific device data sheet to determine availability or use the
10247  PLIB_DMA_ExistsChannelBits function in your application to automatically
10248  determine whether this feature is available.
10249 */
10250 
10251 uint8_t
10253  DMA_MODULE_ID index ) ;
10254 //******************************************************************************
10255 /* Function:
10256  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10257  Summary:
10258  Returns true if the last DMA bus access was a read.
10259  Description:
10260  This function returns true if the last DMA bus access was a read.
10261  Precondition:
10262  None.
10263  Parameters:
10264  None.
10265  Returns:
10266  - true - The last bus access was a read
10267  - false - The last bus access was not a read
10268  Example:
10269  <code>
10270  bool dmaLastBusAccessType;
10271  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10272  </code>
10273  Remarks:
10274  This function implements an operation of the LastBusAccess feature.
10275  This feature may not be available on all devices. Please refer to the
10276  specific device data sheet to determine availability or use the
10277  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10278  determine whether this feature is available.
10279 */
10280 
10281 bool
10283  DMA_MODULE_ID index ) ;
10284 //******************************************************************************
10285 /* Function:
10286  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10287  Summary:
10288  Returns true if the last DMA bus access was a write.
10289  Description:
10290  This function returns true if the last DMA bus access was a write operation.
10291  Precondition:
10292  None.
10293  Parameters:
10294  None.
10295  Returns:
10296  - true - The last bus access was a write operation
10297  - false - The last bus access was not a write operation
10298  Example:
10299  <code>
10300  bool dmaLastBusAccessType;
10301  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10302  </code>
10303  Remarks:
10304  This function implements an operation of the LastBusAccess feature.
10305  This feature may not be available on all devices. Please refer to the
10306  specific device data sheet to determine availability or use the
10307  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10308  determine whether this feature is available.
10309 */
10310 
10311 bool
10313  DMA_MODULE_ID index ) ;
10314 //******************************************************************************
10315 /* Function:
10316  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10317  Summary:
10318  Returns the address of the most recent DMA access.
10319  Description:
10320  This function returns the address of the most recent DMA access.
10321  Precondition:
10322  None.
10323  Parameters:
10324  None.
10325  Returns:
10326  - uint32_t - The most recent address accessed by the DMA
10327  Example:
10328  <code>
10329  uint32_t dmaLastAddressAccessed;
10330  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10331  </code>
10332  Remarks:
10333  This function implements an operation of the RecentAddress feature.
10334  This feature may not be available on all devices. Please refer to the
10335  specific device data sheet to determine availability or use the
10336  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10337  determine whether this feature is available.
10338 */
10339 
10340 uint32_t
10342  DMA_MODULE_ID index ) ;
10343 // *****************************************************************************
10344 // *****************************************************************************
10345 // Section: DMA Module CRC Feature Interface Functions
10346 // *****************************************************************************
10347 // *****************************************************************************
10348 //******************************************************************************
10349 /* Function:
10350  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10351  DMA_CHANNEL channel )
10352  Summary:
10353  Assigns the CRC to the specified DMA channel.
10354  Description:
10355  This function assigns the CRC feature to the specified channel.
10356  Precondition:
10357  None.
10358  Parameters:
10359  channel - One of the possible DMA channels listed by DMA_CHANNEL
10360  Returns:
10361  None.
10362  Example:
10363  <code>
10364  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10365  DMA_CHANNEL_5 );
10366  </code>
10367  Remarks:
10368  This function implements an operation of the CRCChannel feature.
10369  This feature may not be available on all devices. Please refer to the
10370  specific device data sheet to determine availability or use the
10371  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10372  determine whether this feature is available.
10373 */
10374 
10375 void
10377  DMA_MODULE_ID index ,
10378  DMA_CHANNEL channel ) ;
10379 //******************************************************************************
10380 /* Function:
10381  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10382  Summary:
10383  Returns the current DMA channel to which the CRC is assigned.
10384  Description:
10385  This function returns the current DMA channel to which the CRC is assigned.
10386  Precondition:
10387  None.
10388  Parameters:
10389  None.
10390  Returns:
10391  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10392  Example:
10393  <code>
10394  DMA_CHANNEL crcChannel;
10395  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10396  </code>
10397  Remarks:
10398  This function implements an operation of the CRCChannel feature.
10399  This feature may not be available on all devices. Please refer to the
10400  specific device data sheet to determine availability or use the
10401  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10402  determine whether this feature is available.
10403 */
10404 
10405 DMA_CHANNEL
10407  DMA_MODULE_ID index ) ;
10408 //******************************************************************************
10409 /* Function:
10410  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10411  DMA_CRC_TYPE CRCType )
10412  Summary:
10413  Selects the DMA module CRC feature type.
10414  Description:
10415  This function selects the DMA module CRC feature type. The CRC feature will
10416  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10417  checksum.
10418  Precondition:
10419  None.
10420  Parameters:
10421  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10422  Returns:
10423  None.
10424  Example:
10425  <code>
10426  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10427  DMA_CRC_IP_HEADER );
10428  </code>
10429  Remarks:
10430  This function implements an operation of the CRCType feature.
10431  This feature may not be available on all devices. Please refer to the
10432  specific device data sheet to determine availability or use the
10433  PLIB_DMA_ExistsCRCType function in your application to automatically
10434  determine whether this feature is available.
10435 */
10436 
10437 void
10439  DMA_MODULE_ID index ,
10440  DMA_CRC_TYPE CRCType ) ;
10441 //******************************************************************************
10442 /* Function:
10443  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10444  Summary:
10445  Gets the current DMA module CRC feature type.
10446  Description:
10447  This function gets the DMA module CRC feature type. The CRC feature will
10448  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10449  checksum.
10450  Precondition:
10451  None.
10452  Parameters:
10453  None.
10454  Returns:
10455  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10456  Example:
10457  <code>
10458  DMA_CRC_TYPE CRCType;
10459  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10460  </code>
10461  Remarks:
10462  This function implements an operation of the CRCType feature.
10463  This feature may not be available on all devices. Please refer to the
10464  specific device data sheet to determine availability or use the
10465  PLIB_DMA_ExistsCRCType function in your application to automatically
10466  determine whether this feature is available.
10467 */
10468 
10469 DMA_CRC_TYPE
10471  DMA_MODULE_ID index ) ;
10472 //******************************************************************************
10473 /* Function:
10474  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10475  Summary:
10476  Enables the CRC append mode.
10477  Description:
10478  This function enables the CRC append mode. The DMA transfers data from the source
10479  into the CRC, but not to the destination. When a block transfer completes, the
10480  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10481  Precondition:
10482  None.
10483  Parameters:
10484  None.
10485  Returns:
10486  None.
10487  Example:
10488  <code>
10489  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10490  </code>
10491  Remarks:
10492  This function implements an operation of the CRCAppendMode feature.
10493  This feature may not be available on all devices. Please refer to the
10494  specific device data sheet to determine availability or use the
10495  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10496  determine whether this feature is available.
10497 */
10498 
10499 void
10501  DMA_MODULE_ID index ) ;
10502 //******************************************************************************
10503 /* Function:
10504  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10505  Summary:
10506  Gets the enable status of the CRC append mode.
10507  Description:
10508  This function gets the enable status of the CRC append mode.
10509  Precondition:
10510  None.
10511  Parameters:
10512  None.
10513  Returns:
10514  - true - CRC append mode is enabled
10515  - false - CRC append mode is disabled
10516  Example:
10517  <code>
10518  bool DMAcrcAppendMode;
10519  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10520  </code>
10521  Remarks:
10522  This function implements an operation of the CRCAppendMode feature.
10523  This feature may not be available on all devices. Please refer to the
10524  specific device data sheet to determine availability or use the
10525  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10526  determine whether this feature is available.
10527 */
10528 
10529 bool
10531  DMA_MODULE_ID index ) ;
10532 //******************************************************************************
10533 /* Function:
10534  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10535  Summary:
10536  Disables the CRC append mode.
10537  Description:
10538  This function disables the CRC append mode. The DMA transfers data from the
10539  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10540  as it writes the data to the destination.
10541  Precondition:
10542  None.
10543  Parameters:
10544  None.
10545  Returns:
10546  None.
10547  Example:
10548  <code>
10549  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10550  </code>
10551  Remarks:
10552  This function implements an operation of the CRCAppendMode feature.
10553  This feature may not be available on all devices. Please refer to the
10554  specific device data sheet to determine availability or use the
10555  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10556  determine whether this feature is available.
10557 */
10558 
10559 void
10561  DMA_MODULE_ID index ) ;
10562 //******************************************************************************
10563 /* Function:
10564  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10565  Summary:
10566  Enables the DMA module CRC feature.
10567  Description:
10568  This function enables the DMA module CRC feature. The channel transfers are
10569  routed through the CRC.
10570  Precondition:
10571  None.
10572  Parameters:
10573  None.
10574  Returns:
10575  None.
10576  Example:
10577  <code>
10578  PLIB_DMA_CRCEnable( DMA_ID_0 );
10579  </code>
10580  Remarks:
10581  This function implements an operation of the CRC feature.
10582  This feature may not be available on all devices. Please refer to the
10583  specific device data sheet to determine availability or use the
10584  PLIB_DMA_ExistsCRC function in your application to automatically
10585  determine whether this feature is available.
10586 */
10587 
10588 void
10590  DMA_MODULE_ID index ) ;
10591 //******************************************************************************
10592 /* Function:
10593  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10594  Summary:
10595  Gets the enable status of the CRC feature.
10596  Description:
10597  This function gets the enable status of the CRC feature.
10598  Precondition:
10599  None.
10600  Parameters:
10601  None.
10602  Returns:
10603  - true - The CRC feature is enabled
10604  - false - The CRC feature is disabled
10605  Example:
10606  <code>
10607  bool DMAcrcStatus;
10608  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10609  </code>
10610  Remarks:
10611  This function implements an operation of the CRC feature.
10612  This feature may not be available on all devices. Please refer to the
10613  specific device data sheet to determine availability or use the
10614  PLIB_DMA_ExistsCRC function in your application to automatically
10615  determine whether this feature is available.
10616 */
10617 
10618 bool
10620  DMA_MODULE_ID index ) ;
10621 //******************************************************************************
10622 /* Function:
10623  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10624  Summary:
10625  Disables the DMA module CRC feature.
10626  Description:
10627  This function disables the DMA module CRC feature. The channel transfers proceed
10628  normally.
10629  Precondition:
10630  None.
10631  Parameters:
10632  None.
10633  Returns:
10634  None.
10635  Example:
10636  <code>
10637  PLIB_DMA_CRCDisable( DMA_ID_0 );
10638  </code>
10639  Remarks:
10640  This function implements an operation of the CRC feature.
10641  This feature may not be available on all devices. Please refer to the
10642  specific device data sheet to determine availability or use the
10643  PLIB_DMA_ExistsCRC function in your application to automatically
10644  determine whether this feature is available.
10645 */
10646 
10647 void
10649  DMA_MODULE_ID index ) ;
10650 //******************************************************************************
10651 /* Function:
10652  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10653  uint8_t polyLength )
10654  Summary:
10655  Selects the polynomial length.
10656  Description:
10657  This function Selects the polynomial length.
10658  Precondition:
10659  None.
10660  Parameters:
10661  polyLength - Polynomial length
10662  Returns:
10663  None.
10664  Example:
10665  <code>
10666  uint8_t polyLength = 0x2;
10667  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10668  </code>
10669  Remarks:
10670  This function implements an operation of the CRCPolynomialLength feature.
10671  This feature may not be available on all devices. Please refer to the
10672  specific device data sheet to determine availability or use the
10673  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10674  determine whether this feature is available.
10675 */
10676 
10677 void
10679  DMA_MODULE_ID index ,
10680  uint8_t polyLength ) ;
10681 //******************************************************************************
10682 /* Function:
10683  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10684  Summary:
10685  Gets the current polynomial length.
10686  Description:
10687  This function gets the current polynomial length.
10688  Precondition:
10689  None.
10690  Parameters:
10691  None.
10692  Returns:
10693  - uint8_t - Polynomial length
10694  Example:
10695  <code>
10696  uint8_t polyLength;
10697  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10698  </code>
10699  Remarks:
10700  This function implements an operation of the CRCPolynomialLength feature.
10701  This feature may not be available on all devices. Please refer to the
10702  specific device data sheet to determine availability or use the
10703  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10704  determine whether this feature is available.
10705 */
10706 
10707 uint8_t
10709  DMA_MODULE_ID index ) ;
10710 //******************************************************************************
10711 /* Function:
10712  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10713  DMA_CRC_BIT_ORDER bitOrder )
10714  Summary:
10715  Selects the bit order for checksum calculation.
10716  Description:
10717  This function selects the bit order for checksum calculation.
10718  Precondition:
10719  None.
10720  Parameters:
10721  bitOrder - Specifies the bit order for CRC calculation
10722  Returns:
10723  None.
10724  Example:
10725  <code>
10726  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10727  </code>
10728  Remarks:
10729  This function implements an operation of the CRCBitOrder feature.
10730  This feature may not be available on all devices. Please refer to the
10731  specific device data sheet to determine availability or use the
10732  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10733  determine whether this feature is available.
10734 */
10735 
10736 void
10738  DMA_MODULE_ID index ,
10739  DMA_CRC_BIT_ORDER bitOrder ) ;
10740 //******************************************************************************
10741 /* Function:
10742  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10743  Summary:
10744  The source data is written to the destination reordered as defined by the
10745  BYTO<1:0> bits.
10746  Description:
10747  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10748  The source data is written to the destination reordered as defined by the
10749  BYTO<1:0> bits.
10750  Precondition:
10751  None.
10752  Parameters:
10753  None.
10754  Returns:
10755  None.
10756  Example:
10757  <code>
10758  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10759  </code>
10760  Remarks:
10761  This function implements an operation of the CRCWriteByteOrder feature.
10762  This feature may not be available on all devices. Please refer to the
10763  specific device data sheet to determine availability or use the
10764  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10765  determine whether this feature is available.
10766 */
10767 
10768 void
10770  DMA_MODULE_ID index ) ;
10771 //******************************************************************************
10772 /* Function:
10773  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10774  Summary:
10775  The source data is written to the destination unaltered.
10776  Description:
10777  This function disables byte order alteration. The source data is written
10778  to the destination unaltered.
10779  Precondition:
10780  None.
10781  Parameters:
10782  None.
10783  Returns:
10784  None.
10785  Example:
10786  <code>
10787  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10788  </code>
10789  Remarks:
10790  This function implements an operation of the CRCWriteByteOrder feature.
10791  This feature may not be available on all devices. Please refer to the
10792  specific device data sheet to determine availability or use the
10793  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10794  determine whether this feature is available.
10795 */
10796 
10797 void
10799  DMA_MODULE_ID index ) ;
10800 //******************************************************************************
10801 /* Function:
10802  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10803  DMA_CRC_BYTE_ORDER byteOrder )
10804  Summary:
10805  Selects the byte order.
10806  Description:
10807  This function selects the byte order.
10808  Precondition:
10809  The WBO bit must be set to use this function.
10810  Parameters:
10811  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10812  Returns:
10813  None.
10814  Example:
10815  <code>
10816  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10817  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10818  </code>
10819  Remarks:
10820  This function implements an operation of the CRCByteOrder feature.
10821  This feature may not be available on all devices. Please refer to the
10822  specific device data sheet to determine availability or use the
10823  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10824  determine whether this feature is available.
10825 */
10826 
10827 void
10829  DMA_MODULE_ID index ,
10830  DMA_CRC_BYTE_ORDER byteOrder ) ;
10831 //******************************************************************************
10832 /* Function:
10833  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10834  Summary:
10835  Gets the current byte order selected by the DMA module CRC feature.
10836  Description:
10837  This function gets the current byte order selected by the DMA module CRC feature.
10838  Precondition:
10839  The WBO bit must be set to use this function.
10840  Parameters:
10841  None.
10842  Returns:
10843  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10844  Example:
10845  <code>
10846  DMA_CRC_BYTE_ORDER byteOrder;
10847  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10848  </code>
10849  Remarks:
10850  This function implements an operation of the CRCByteOrder feature.
10851  This feature may not be available on all devices. Please refer to the
10852  specific device data sheet to determine availability or use the
10853  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10854  determine whether this feature is available.
10855 */
10856 
10857 DMA_CRC_BYTE_ORDER
10859  DMA_MODULE_ID index ) ;
10860 //******************************************************************************
10861 /* Function:
10862  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10863  Summary:
10864  Reads the contents of the DMA CRC data register.
10865  Description:
10866  This function reads the contents of the DMA CRC data register.
10867  Precondition:
10868  None.
10869  Parameters:
10870  None.
10871  Returns:
10872  - uint32_t - 32-bit CRC data
10873  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10874  device data sheet to determine availability.
10875  Example:
10876  <code>
10877  uint32_t DMACRCdata;
10878  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10879  </code>
10880  Remarks:
10881  This function implements an operation of the CRCData feature.
10882  This feature may not be available on all devices. Please refer to the
10883  specific device data sheet to determine availability or use the
10884  PLIB_DMA_ExistsCRCData function in your application to automatically
10885  determine whether this feature is available.
10886 */
10887 
10888 uint32_t
10890  DMA_MODULE_ID index ) ;
10891 //******************************************************************************
10892 /* Function:
10893  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10894  uint32_t DMACRCdata )
10895  Summary:
10896  Writes the contents of the DMA CRC data register with the specified data.
10897  Description:
10898  This function writes the contents of the DMA CRC data register.
10899  Precondition:
10900  None.
10901  Parameters:
10902  - DMACRCdata - 32-bit CRC data
10903  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10904  device data sheet to determine availability.
10905  Returns:
10906  None.
10907  Example:
10908  <code>
10909  uint32_t DMACRCdata = 0x0E0E0E;
10910  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10911  </code>
10912  Remarks:
10913  This function implements an operation of the CRCData feature.
10914  This feature may not be available on all devices. Please refer to the
10915  specific device data sheet to determine availability or use the
10916  PLIB_DMA_ExistsCRCData function in your application to automatically
10917  determine whether this feature is available.
10918 */
10919 
10920 void
10922  DMA_MODULE_ID index ,
10923  uint32_t DMACRCdata ) ;
10924 //******************************************************************************
10925 /* Function:
10926  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10927  Summary:
10928  Reads the CRC XOR register.
10929  Description:
10930  This function reads the CRC XOR register.
10931  Precondition:
10932  None.
10933  Parameters:
10934  None.
10935  Returns:
10936  - uint32_t - 32-bit CRC XOR enable mask data
10937  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10938  device data sheet to determine availability.
10939  Example:
10940  <code>
10941  uint32_t DMACRCXORdata;
10942  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10943  </code>
10944  Remarks:
10945  This function implements an operation of the CRCXOREnable feature.
10946  This feature may not be available on all devices. Please refer to the
10947  specific device data sheet to determine availability or use the
10948  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10949  determine whether this feature is available.
10950 */
10951 
10952 uint32_t
10954  DMA_MODULE_ID index ) ;
10955 //******************************************************************************
10956 /* Function:
10957  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10958  uint32_t DMACRCXOREnableMask )
10959  Summary:
10960  Writes to the CRC XOR enable register as per the specified enable mask.
10961  Description:
10962  This function writes to the CRC XOR enable register as per the specified
10963  enable mask. Each enabled bit will be taken as input to the shift register.
10964  Precondition:
10965  None.
10966  Parameters:
10967  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10968  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10969  device data sheet to determine availability.
10970  Returns:
10971  None.
10972  Example:
10973  <code>
10974  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10975  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10976  </code>
10977  Remarks:
10978  This function implements an operation of the CRCXOREnable feature.
10979  This feature may not be available on all devices. Please refer to the
10980  specific device data sheet to determine availability or use the
10981  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10982  determine whether this feature is available.
10983 */
10984 
10985 void
10987  DMA_MODULE_ID index ,
10988  uint32_t DMACRCXOREnableMask ) ;
10989 // *****************************************************************************
10990 // *****************************************************************************
10991 // Section: DMA Address control Interface functions
10992 // *****************************************************************************
10993 // *****************************************************************************
10994 //******************************************************************************
10995 /* Function:
10996  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
10997  DMA_CHANNEL dmaChannel )
10998  Summary:
10999  Reads the source start address configured for the specified channel.
11000  Description:
11001  This function reads the source start address configured for the specified
11002  channel.
11003  Precondition:
11004  None.
11005  Parameters:
11006  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11007  Returns:
11008  - uint32_t - The source start address configured for this channel
11009  Example:
11010  <code>
11011  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11012  uint32_t SourceStartAddress;
11013  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11014  spiDMAChannel );
11015  </code>
11016  Remarks:
11017  This function implements an operation of the ChannelXSourceStartAddress feature.
11018  This feature may not be available on all devices. Please refer to the
11019  specific device data sheet to determine availability or use the
11020  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11021  determine whether this feature is available.
11022 */
11023 
11024 uint32_t
11026  DMA_MODULE_ID index ,
11027  DMA_CHANNEL dmaChannel ) ;
11028 //******************************************************************************
11029 /* Function:
11030  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11031  DMA_CHANNEL dmaChannel,
11032  uint32_t sourceStartAddress)
11033  Summary:
11034  Writes the specified source start address into the register
11035  corresponding to the specified channel.
11036  Description:
11037  This function writes the specified Source start address into the register
11038  corresponding to the specified channel.
11039  Precondition:
11040  None.
11041  Parameters:
11042  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11043  sourceStartAddress - The source start address
11044  Returns:
11045  None.
11046  Example:
11047  <code>
11048  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11049  uint32_t sourceStartAddress = 0x00FDEA00;
11050  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11051  spiDMAChannel,
11052  sourceStartAddress );
11053  </code>
11054  Remarks:
11055  This function implements an operation of the ChannelXSourceStartAddress feature.
11056  This feature may not be available on all devices. Please refer to the
11057  specific device data sheet to determine availability or use the
11058  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11059  determine whether this feature is available.
11060 */
11061 
11062 void
11064  DMA_MODULE_ID index ,
11065  DMA_CHANNEL dmaChannel ,
11066  uint32_t sourceStartAddress ) ;
11067 //******************************************************************************
11068 /* Function:
11069  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11070  DMA_CHANNEL dmaChannel )
11071  Summary:
11072  Reads the destination start address configured for the specified channel.
11073  Description:
11074  This function reads the destination start address configured for the specified
11075  channel.
11076  Precondition:
11077  None.
11078  Parameters:
11079  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11080  Returns:
11081  - uint32_t - The destination start address configured for this channel
11082  Example:
11083  <code>
11084  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11085  uint32_t DestinationStartAddress;
11086  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11087  DMA_ID_0,
11088  spiDMAChannel );
11089  </code>
11090  Remarks:
11091  This function implements an operation of the ChannelXDestinationStartAddress feature.
11092  This feature may not be available on all devices. Please refer to the
11093  specific device data sheet to determine availability or use the
11094  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11095  determine whether this feature is available.
11096 */
11097 
11098 uint32_t
11100  DMA_MODULE_ID index ,
11101  DMA_CHANNEL dmaChannel ) ;
11102 //******************************************************************************
11103 /* Function:
11104  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11105  DMA_MODULE_ID index,
11106  DMA_CHANNEL dmaChannel,
11107  uint32_t destinationStartAddress)
11108  Summary:
11109  Writes the specified destination start address into the register corresponding to
11110  the specified channel.
11111  Description:
11112  This function writes the specified destination start address into the register
11113  corresponding to the specified channel.
11114  Precondition:
11115  None.
11116  Parameters:
11117  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11118  destinationStartAddress - The destination start address
11119  Returns:
11120  None.
11121  Example:
11122  <code>
11123  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11124  uint32_t destinationStartAddress = 0x00FDEA00;
11125  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11126  spiDMAChannel,
11127  destinationStartAddress );
11128  </code>
11129  Remarks:
11130  This function implements an operation of the ChannelXDestinationStartAddress feature.
11131  This feature may not be available on all devices. Please refer to the
11132  specific device data sheet to determine availability or use the
11133  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11134  determine whether this feature is available.
11135 */
11136 
11137 void
11139  DMA_MODULE_ID index ,
11140  DMA_CHANNEL dmaChannel ,
11141  uint32_t destinationStartAddress ) ;
11142 // *****************************************************************************
11143 // *****************************************************************************
11144 // Section: DMA Data control Interface functions
11145 // *****************************************************************************
11146 // *****************************************************************************
11147 //******************************************************************************
11148 /* Function:
11149  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11150  DMA_CHANNEL dmaChannel )
11151  Summary:
11152  Reads the source size configured for the specified channel.
11153  Description:
11154  This function reads the source size configured for the specified
11155  channel.
11156  Precondition:
11157  None.
11158  Parameters:
11159  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11160  Returns:
11161  - uint16_t - The Source size configured (in bytes) for this channel.
11162  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11163  device data sheet to determine availability.
11164  Example:
11165  <code>
11166  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11167  uint16_t sourceSize;
11168  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11169  spiDMAChannel );
11170  </code>
11171  Remarks:
11172  This function implements an operation of the ChannelXSourceSize feature.
11173  This feature may not be available on all devices. Please refer to the
11174  specific device data sheet to determine availability or use the
11175  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11176  determine whether this feature is available.
11177 */
11178 
11179 uint16_t
11181  DMA_MODULE_ID index ,
11182  DMA_CHANNEL dmaChannel ) ;
11183 //******************************************************************************
11184 /* Function:
11185  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11186  DMA_CHANNEL dmaChannel,
11187  uint16_t sourceSize)
11188  Summary:
11189  Writes the specified source size into the register corresponding
11190  to the specified channel.
11191  Description:
11192  This function writes the specified source size into the register
11193  corresponding to the specified channel.
11194  Precondition:
11195  None.
11196  Parameters:
11197  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11198  sourceSize - The source size. The source size (8-bit, 16-bit) is
11199  device-specific. Please refer to the specific device data
11200  sheet to determine availability.
11201  Returns:
11202  None.
11203  Example:
11204  <code>
11205  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11206  uint16_t sourceSize = 0xA00;
11207  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11208  spiDMAChannel,
11209  sourceSize );
11210  </code>
11211  Remarks:
11212  This function implements an operation of the ChannelXSourceSize feature.
11213  This feature may not be available on all devices. Please refer to the
11214  specific device data sheet to determine availability or use the
11215  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11216  determine whether this feature is available.
11217 */
11218 
11219 void
11221  DMA_MODULE_ID index ,
11222  DMA_CHANNEL dmaChannel ,
11223  uint16_t sourceSize ) ;
11224 //******************************************************************************
11225 /* Function:
11226  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11227  DMA_CHANNEL dmaChannel )
11228  Summary:
11229  Reads the destination size configured for the specified channel.
11230  Description:
11231  This function reads the destination size configured for the specified
11232  channel.
11233  Precondition:
11234  None.
11235  Parameters:
11236  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11237  Returns:
11238  - uint16_t - The destination size configured (in bytes) for this channel.
11239  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11240  device data sheet to determine availability.
11241  Example:
11242  <code>
11243  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11244  uint16_t DestinationSize;
11245  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11246  spiDMAChannel );
11247  </code>
11248  Remarks:
11249  This function implements an operation of the ChannelXDestinationSize feature.
11250  This feature may not be available on all devices. Please refer to the
11251  specific device data sheet to determine availability or use the
11252  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11253  determine whether this feature is available.
11254 */
11255 
11256 uint16_t
11258  DMA_MODULE_ID index ,
11259  DMA_CHANNEL dmaChannel ) ;
11260 //******************************************************************************
11261 /* Function:
11262  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11263  DMA_CHANNEL dmaChannel,
11264  uint16_t destinationSize)
11265  Summary:
11266  Writes the specified destination size into the register corresponding
11267  to the specified channel.
11268  Description:
11269  This function writes the specified destination size into the register
11270  corresponding to the specified channel.
11271  Precondition:
11272  None.
11273  Parameters:
11274  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11275  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11276  is device-specific. Please refer to the specific device
11277  data sheet to determine availability.)
11278  Returns:
11279  None.
11280  Example:
11281  <code>
11282  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11283  uint16_t destinationSize = 0xA00;
11284  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11285  </code>
11286  Remarks:
11287  This function implements an operation of the ChannelXDestinationSize feature.
11288  This feature may not be available on all devices. Please refer to the
11289  specific device data sheet to determine availability or use the
11290  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11291  determine whether this feature is available.
11292 */
11293 
11294 void
11296  DMA_MODULE_ID index ,
11297  DMA_CHANNEL dmaChannel ,
11298  uint16_t destinationSize ) ;
11299 //******************************************************************************
11300 /* Function:
11301  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11302  DMA_CHANNEL dmaChannel )
11303  Summary:
11304  Reads the current byte of the source being pointed to for the specified channel.
11305  Description:
11306  This function reads the current byte of the source being pointed to for the
11307  specified channel.
11308  Precondition:
11309  None.
11310  Parameters:
11311  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11312  Returns:
11313  - uint16_t - The source byte being pointed to for this channel.
11314  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11315  device data sheet to determine availability.
11316  Example:
11317  <code>
11318  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11319  uint16_t sourcebyte;
11320  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11321  </code>
11322  Remarks:
11323  This function implements an operation of the ChannelXSourcePointer feature.
11324  This feature may not be available on all devices. Please refer to the
11325  specific device data sheet to determine availability or use the
11326  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11327  determine whether this feature is available.
11328 */
11329 
11330 uint16_t
11332  DMA_MODULE_ID index ,
11333  DMA_CHANNEL dmaChannel ) ;
11334 //******************************************************************************
11335 /* Function:
11336  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11337  DMA_CHANNEL dmaChannel )
11338  Summary:
11339  Reads the current byte of the destination being pointed to for the specified channel.
11340  Description:
11341  This function reads the current byte of the destination being pointed to for the
11342  specified channel.
11343  Precondition:
11344  None.
11345  Parameters:
11346  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11347  Returns:
11348  - uint16_t - The destination byte being pointed to for this channel.
11349  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11350  device data sheet to determine availability.
11351  Example:
11352  <code>
11353  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11354  uint16_t destinationbyte;
11355  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11356  spiDMAChannel );
11357  </code>
11358  Remarks:
11359  This function implements an operation of the ChannelXDestinationPointer feature.
11360  This feature may not be available on all devices. Please refer to the
11361  specific device data sheet to determine availability or use the
11362  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11363  determine whether this feature is available.
11364 */
11365 
11366 uint16_t
11368  DMA_MODULE_ID index ,
11369  DMA_CHANNEL dmaChannel ) ;
11370 //******************************************************************************
11371 /* Function:
11372  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11373  DMA_CHANNEL dmaChannel )
11374  Summary:
11375  Reads the cell size (in bytes) configured for the specified channel.
11376  Description:
11377  This function reads the cell size (in bytes) configured for the specified
11378  channel.
11379  Precondition:
11380  None.
11381  Parameters:
11382  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11383  Returns:
11384  - uint16_t - The cell size configured (in bytes) for this channel
11385  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11386  device data sheet to determine availability.
11387  Example:
11388  <code>
11389  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11390  uint16_t cellSize;
11391  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11392  spiDMAChannel );
11393  </code>
11394  Remarks:
11395  This function implements an operation of the ChannelXCellSize feature.
11396  This feature may not be available on all devices. Please refer to the
11397  specific device data sheet to determine availability or use the
11398  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11399  determine whether this feature is available.
11400 */
11401 
11402 uint16_t
11404  DMA_MODULE_ID index ,
11405  DMA_CHANNEL dmaChannel ) ;
11406 //******************************************************************************
11407 /* Function:
11408  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11409  DMA_CHANNEL dmaChannel,
11410  uint16_t cellSize)
11411  Summary:
11412  Writes the specified cell size into the register corresponding
11413  to the specified channel.
11414  Description:
11415  This function writes the specified cell size into the register
11416  corresponding to the specified channel.
11417  Precondition:
11418  None.
11419  Parameters:
11420  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11421  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11422  device-specific. Please refer to the specific device data
11423  sheet to determine availability.)
11424  Returns:
11425  None.
11426  Example:
11427  <code>
11428  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11429  uint16_t cellSize = 0x10;
11430  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11431  </code>
11432  Remarks:
11433  This function implements an operation of the ChannelXCellSize feature.
11434  This feature may not be available on all devices. Please refer to the
11435  specific device data sheet to determine availability or use the
11436  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11437  determine whether this feature is available.
11438 */
11439 
11440 void
11442  DMA_MODULE_ID index ,
11443  DMA_CHANNEL dmaChannel ,
11444  uint16_t CellSize ) ;
11445 //******************************************************************************
11446 /* Function:
11447  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11448  DMA_CHANNEL dmaChannel )
11449  Summary:
11450  Returns the number of bytes transferred since the last event.
11451  Description:
11452  This function returns the number of bytes transferred since the last event.
11453  Precondition:
11454  None.
11455  Parameters:
11456  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11457  Returns:
11458  - uint16_t - The number of bytes transferred since the last event.
11459  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11460  the specific device data sheet to determine availability.
11461  Example:
11462  <code>
11463  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11464  uint16_t CellProgress;
11465  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11466  spiDMAChannel );
11467  </code>
11468  Remarks:
11469  This function implements an operation of the ChannelXCellProgressPointer feature.
11470  This feature may not be available on all devices. Please refer to the
11471  specific device data sheet to determine availability or use the
11472  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11473  determine whether this feature is available.
11474 */
11475 
11476 uint16_t
11478  DMA_MODULE_ID index ,
11479  DMA_CHANNEL dmaChannel ) ;
11480 //******************************************************************************
11481 /* Function:
11482  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11483  DMA_CHANNEL dmaChannel )
11484  Summary:
11485  Returns the pattern matching (for DMA abort) data programmed for the specified
11486  channel.
11487  Description:
11488  This function returns pattern matching (for DMA abort) data programmed for
11489  the specified channel.
11490  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11491  the specific device data sheet to determine availability.)
11492  Precondition:
11493  None.
11494  Parameters:
11495  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11496  Returns:
11497  - uint16_t - The pattern matching data programmed for the current channel.
11498  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11499  the specific device data sheet to determine availability.
11500  Example:
11501  <code>
11502  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11503  uint16_t patternData;
11504  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11505  </code>
11506  Remarks:
11507  This function implements an operation of the ChannelXPatternData feature.
11508  This feature may not be available on all devices. Please refer to the
11509  specific device data sheet to determine availability or use the
11510  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11511  determine whether this feature is available.
11512 */
11513 
11514 uint16_t
11516  DMA_MODULE_ID index ,
11517  DMA_CHANNEL dmaChannel ) ;
11518 //******************************************************************************
11519 /* Function:
11520  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11521  DMA_CHANNEL dmaChannel,
11522  uint16_t patternData)
11523  Summary:
11524  Writes the specified pattern matching data (for DMA abort) into the register
11525  corresponding to the specified channel.
11526  Description:
11527  This function writes the specified pattern matching data (for DMA abort) into the
11528  register corresponding to the specified channel.
11529  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11530  the specific device data sheet to determine availability.)
11531  Precondition:
11532  None.
11533  Parameters:
11534  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11535  patternData - The pattern matching DATA programmed for the current channel
11536  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11537  the specific device data sheet to determine availability.)
11538  Returns:
11539  None.
11540  Example:
11541  <code>
11542  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11543  uint16_t patternData = '\0';
11544  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11545  </code>
11546  Remarks:
11547  This function implements an operation of the ChannelXPatternData feature.
11548  This feature may not be available on all devices. Please refer to the
11549  specific device data sheet to determine availability or use the
11550  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11551  determine whether this feature is available.
11552 */
11553 
11554 void
11556  DMA_MODULE_ID index ,
11557  DMA_CHANNEL dmaChannel ,
11558  uint16_t patternData ) ;
11559 // *****************************************************************************
11560 // *****************************************************************************
11561 // Section: DMA Interrupt Control Interface functions
11562 // *****************************************************************************
11563 // *****************************************************************************
11564 //******************************************************************************
11565 /* Function:
11566  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11567  DMA_CHANNEL dmaChannel,
11568  DMA_INT_TYPE dmaINTSource )
11569  Summary:
11570  Returns the status of the interrupt flag of the specified DMA interrupt source
11571  for the specified channel.
11572  Description:
11573  This function returns the status of the interrupt flag of the specified DMA interrupt
11574  source for the specified channel.
11575  Precondition:
11576  None.
11577  Parameters:
11578  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11579  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11580  Returns:
11581  - true - The interrupt flag is set
11582  - false - The interrupt flag is not set
11583  Example:
11584  <code>
11585  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11586  bool AddressErrorINTStatus;
11587  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11588  DMA_ID_0,
11589  spiDMAChannel,
11590  DMA_INT_ADDRESS_ERROR );
11591  </code>
11592  Remarks:
11593  This function implements an operation of the ChannelXINTSourceFlag feature.
11594  This feature may not be available on all devices. Please refer to the
11595  specific device data sheet to determine availability or use the
11596  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11597  determine whether this feature is available.
11598 */
11599 
11600 bool
11602  DMA_MODULE_ID index ,
11603  DMA_CHANNEL dmaChannel ,
11604  DMA_INT_TYPE dmaINTSource ) ;
11605 //******************************************************************************
11606 /* Function:
11607  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11608  DMA_CHANNEL dmaChannel,
11609  DMA_INT_TYPE dmaINTSource )
11610  Summary:
11611  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11612  Description:
11613  This function sets the interrupt flag of the specified DMA interrupt source for
11614  the specified channel.
11615  Precondition:
11616  None.
11617  Parameters:
11618  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11619  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11620  Returns:
11621  None.
11622  Example:
11623  <code>
11624  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11625  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11626  spiDMAChannel,
11627  DMA_INT_ADDRESS_ERROR );
11628  </code>
11629  Remarks:
11630  This function implements an operation of the ChannelXINTSourceFlag feature.
11631  This feature may not be available on all devices. Please refer to the
11632  specific device data sheet to determine availability or use the
11633  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11634  determine whether this feature is available.
11635 */
11636 
11637 void
11639  DMA_MODULE_ID index ,
11640  DMA_CHANNEL dmaChannel ,
11641  DMA_INT_TYPE dmaINTSource ) ;
11642 //******************************************************************************
11643 /* Function:
11644  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11645  DMA_CHANNEL dmaChannel,
11646  DMA_INT_TYPE dmaINTSource )
11647  Summary:
11648  Clears the interrupt flag of the specified DMA interrupt source
11649  for the specified channel.
11650  Description:
11651  This function clears the interrupt flag of the specified DMA interrupt source
11652  for the specified channel.
11653  Precondition:
11654  None.
11655  Parameters:
11656  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11657  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11658  Returns:
11659  None.
11660  Example:
11661  <code>
11662  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11663  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11664  spiDMAChannel,
11665  DMA_INT_ADDRESS_ERROR );
11666  </code>
11667  Remarks:
11668  This function implements an operation of the ChannelXINTSourceFlag feature.
11669  This feature may not be available on all devices. Please refer to the
11670  specific device data sheet to determine availability or use the
11671  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11672  determine whether this feature is available.
11673 */
11674 
11675 void
11677  DMA_MODULE_ID index ,
11678  DMA_CHANNEL dmaChannel ,
11679  DMA_INT_TYPE dmaINTSource ) ;
11680 //******************************************************************************
11681 /* Function:
11682  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11683  DMA_CHANNEL dmaChannel,
11684  DMA_INT_TYPE dmaINTSource )
11685  Summary:
11686  Enables the specified interrupt source for the specified channel.
11687  Description:
11688  This function enables the specified interrupt source for the specified channel.
11689  Precondition:
11690  None.
11691  Parameters:
11692  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11693  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11694  Returns:
11695  None.
11696  Example:
11697  <code>
11698  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11699  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11700  spiDMAChannel,
11701  DMA_INT_ADDRESS_ERROR );
11702  </code>
11703  Remarks:
11704  This function implements an operation of the ChannelXINTSource feature.
11705  This feature may not be available on all devices. Please refer to the
11706  specific device data sheet to determine availability or use the
11707  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11708  determine whether this feature is available.
11709 */
11710 
11711 void
11713  DMA_MODULE_ID index ,
11714  DMA_CHANNEL dmaChannel ,
11715  DMA_INT_TYPE dmaINTSource ) ;
11716 //******************************************************************************
11717 /* Function:
11718  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11719  DMA_CHANNEL dmaChannel,
11720  DMA_INT_TYPE dmaINTSource )
11721  Summary:
11722  Disables the specified interrupt source for the specified channel.
11723  Description:
11724  This function disables the specified interrupt source for the specified channel.
11725  Precondition:
11726  None.
11727  Parameters:
11728  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11729  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11730  Returns:
11731  None.
11732  Example:
11733  <code>
11734  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11735  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11736  spiDMAChannel,
11737  DMA_INT_ADDRESS_ERROR );
11738  </code>
11739  Remarks:
11740  This function implements an operation of the ChannelXINTSource feature.
11741  This feature may not be available on all devices. Please refer to the
11742  specific device data sheet to determine availability or use the
11743  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11744  determine whether this feature is available.
11745 */
11746 
11747 void
11749  DMA_MODULE_ID index ,
11750  DMA_CHANNEL dmaChannel ,
11751  DMA_INT_TYPE dmaINTSource ) ;
11752 //******************************************************************************
11753 /* Function:
11754  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11755  DMA_CHANNEL dmaChannel,
11756  DMA_INT_TYPE dmaINTSource )
11757  Summary:
11758  Returns the enable status of the specified interrupt source for the specified channel.
11759  Description:
11760  This function returns the enable status of the specified interrupt source for the
11761  specified channel.
11762  Precondition:
11763  None.
11764  Parameters:
11765  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11766  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11767  Returns:
11768  - true - The interrupt is enabled
11769  - false - The interrupt is not enabled
11770  Example:
11771  <code>
11772  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11773  bool dmaINTSourceEnableStatus;
11774  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11775  DMA_ID_0,
11776  spiDMAChannel,
11777  DMA_INT_ADDRESS_ERROR );
11778  </code>
11779  Remarks:
11780  This function implements an operation of the ChannelXINTSource feature.
11781  This feature may not be available on all devices. Please refer to the
11782  specific device data sheet to determine availability or use the
11783  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11784  determine whether this feature is available.
11785 */
11786 
11787 bool
11789  DMA_MODULE_ID index ,
11790  DMA_CHANNEL dmaChannel ,
11791  DMA_INT_TYPE dmaINTSource ) ;
11792 //******************************************************************************
11793 /* Function:
11794  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11795  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11796  Summary:
11797  Sets the pattern match length.
11798  Description:
11799  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11800  Precondition:
11801  None.
11802  Parameters:
11803  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11804  patternLen - Length of pattern match (either 1 or 2)
11805  Returns:
11806  None.
11807  Example:
11808  <code>
11809  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11810  DMA_PATTERN_LENGTH patternLen;
11811  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11812  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11813  </code>
11814  Remarks:
11815  This function implements an operation of the ChannelXPatternLength feature.
11816  This feature may not be available on all devices. Please refer to the
11817  specific device data sheet to determine availability or use the
11818  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11819  determine whether this feature is available.
11820 */
11821 
11822 void
11824  DMA_MODULE_ID index ,
11825  DMA_CHANNEL dmaChannel ,
11826  DMA_PATTERN_LENGTH patternLen ) ;
11827 //******************************************************************************
11828 /* Function:
11829  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11830  DMA_CHANNEL dmaChannel);
11831  Summary:
11832  Returns the pattern match length.
11833  Description:
11834  This function returns the length of the byte matching the CHPIGN bits during a
11835  pattern match that may be ignored during the pattern match determination when
11836  the CHPIGNEN bit is set.
11837  Precondition:
11838  None.
11839  Parameters:
11840  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11841  Returns:
11842  - patternLen - Length of pattern match (either 1 or 2)
11843  Example:
11844  <code>
11845  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11846  DMA_PATTERN_LENGTH patternLen;
11847  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11848  </code>
11849  Remarks:
11850  This function implements an operation of the ChannelXPatternLength feature.
11851  This feature may not be available on all devices. Please refer to the
11852  specific device data sheet to determine availability or use the
11853  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11854  determine whether this feature is available.
11855 */
11856 
11857 DMA_PATTERN_LENGTH
11859  DMA_MODULE_ID index ,
11860  DMA_CHANNEL dmaChannel ) ;
11861 //******************************************************************************
11862 /* Function:
11863  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11864  DMA_CHANNEL channel );
11865  Summary:
11866  Enables the pattern match ignore byte.
11867  Description:
11868  This function enables the pattern match ignore byte.
11869  Precondition:
11870  None.
11871  Parameters:
11872  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11873  Returns:
11874  None.
11875  Example:
11876  <code>
11877  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11878  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11879  </code>
11880  Remarks:
11881  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11882  This feature may not be available on all devices. Please refer to the
11883  specific device data sheet to determine availability or use the
11884  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11885  determine whether this feature is available.
11886 */
11887 
11888 void
11890  DMA_MODULE_ID index ,
11891  DMA_CHANNEL channel ) ;
11892 //******************************************************************************
11893 /* Function:
11894  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11895  DMA_CHANNEL channel );
11896  Summary:
11897  Returns the state of the pattern match ignore byte.
11898  Description:
11899  This function returns the state (enabled or disabled) of the pattern match
11900  ignore byte.
11901  Precondition:
11902  None.
11903  Parameters:
11904  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11905  Returns:
11906  - true - The pattern match ignore byte is enabled
11907  - false - The pattern match ignore byte is disabled
11908  Example:
11909  <code>
11910  bool patternIsEnabled;
11911  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11912  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11913  </code>
11914  Remarks:
11915  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11916  This feature may not be available on all devices. Please refer to the
11917  specific device data sheet to determine availability or use the
11918  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11919  determine whether this feature is available.
11920 */
11921 
11922 bool
11924  DMA_MODULE_ID index ,
11925  DMA_CHANNEL channel ) ;
11926 //******************************************************************************
11927 /* Function:
11928  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11929  DMA_CHANNEL channel );
11930  Summary:
11931  Disables the pattern match ignore byte.
11932  Description:
11933  This function disables the pattern match ignore byte.
11934  Precondition:
11935  None.
11936  Parameters:
11937  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11938  Returns:
11939  None.
11940  Example:
11941  <code>
11942  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11943  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11944  </code>
11945  Remarks:
11946  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11947  This feature may not be available on all devices. Please refer to the
11948  specific device data sheet to determine availability or use the
11949  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11950  determine whether this feature is available.
11951 */
11952 
11953 void
11955  DMA_MODULE_ID index ,
11956  DMA_CHANNEL channel ) ;
11957 //******************************************************************************
11958 /* Function:
11959  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11960  DMA_CHANNEL channel, uint8_t pattern );
11961  Summary:
11962  Sets the pattern match ignore value.
11963  Description:
11964  This function sets the value of the pattern match ignore.
11965  Precondition:
11966  None.
11967  Parameters:
11968  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11969  pattern - Pattern match ignore value
11970  Returns:
11971  None.
11972  Example:
11973  <code>
11974  uint8_t patternMatch = 0x8;
11975  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11976  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11977  </code>
11978  Remarks:
11979  This function implements an operation of the ChannelXPatternIgnore feature.
11980  This feature may not be available on all devices. Please refer to the
11981  specific device data sheet to determine availability or use the
11982  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11983  determine whether this feature is available.
11984 */
11985 
11986 void
11988  DMA_MODULE_ID index ,
11989  DMA_CHANNEL channel ,
11990  uint8_t pattern ) ;
11991 //******************************************************************************
11992 /* Function:
11993  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11994  DMA_CHANNEL channel );
11995  Summary:
11996  Returns the pattern match ignore value.
11997  Description:
11998  This function returns the value of the pattern match ignore.
11999  Precondition:
12000  None.
12001  Parameters:
12002  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12003  Returns:
12004  - uint8_t - Pattern match ignore value
12005  Example:
12006  <code>
12007  uint8_t patternMatch;
12008  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12009  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12010  </code>
12011  Remarks:
12012  This function implements an operation of the ChannelXPatternIgnore feature.
12013  This feature may not be available on all devices. Please refer to the
12014  specific device data sheet to determine availability or use the
12015  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12016  determine whether this feature is available.
12017 */
12018 
12019 uint8_t
12021  DMA_MODULE_ID index ,
12022  DMA_CHANNEL channel ) ;
12023 // *****************************************************************************
12024 // *****************************************************************************
12025 // Section: DMA Peripheral Library Exists API Routines
12026 // *****************************************************************************
12027 // *****************************************************************************
12028 /* The following functions indicate the existence of the features on the device.
12029 */
12030 //******************************************************************************
12031 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12032  Summary:
12033  Identifies whether the Busy feature exists on the DMA module.
12034  Description:
12035  This function identifies whether the Busy feature is available on the
12036  DMA module.
12037  When this function returns true, these functions are supported on the device:
12038  - PLIB_DMA_BusyActiveSet
12039  - PLIB_DMA_BusyActiveReset
12040  - PLIB_DMA_IsBusy
12041  Preconditions:
12042  None.
12043  Parameters:
12044  index - Identifier for the device instance
12045  Returns:
12046  - true - The Busy feature is supported on the device
12047  - false - The Busy feature is not supported on the device
12048  Remarks:
12049  None.
12050 */
12051 
12052 bool
12054  DMA_MODULE_ID index ) ;
12055 //******************************************************************************
12056 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12057  Summary:
12058  Identifies whether the Suspend feature exists on the DMA module.
12059  Description:
12060  This function identifies whether the Suspend feature is available on the
12061  DMA module.
12062  When this function returns true, these functions are supported on the device:
12063  - PLIB_DMA_SuspendEnable
12064  - PLIB_DMA_SuspendDisable
12065  - PLIB_DMA_SuspendIsEnabled
12066  Preconditions:
12067  None.
12068  Parameters:
12069  index - Identifier for the device instance
12070  Returns:
12071  - true - The Suspend feature is supported on the device
12072  - false - The Suspend feature is not supported on the device
12073  Remarks:
12074  None.
12075 */
12076 
12077 bool
12079  DMA_MODULE_ID index ) ;
12080 //******************************************************************************
12081 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12082  Summary:
12083  Identifies whether the StopInIdle feature exists on the DMA module.
12084  Description:
12085  This function identifies whether the StopInIdle feature is available on the
12086  DMA module.
12087  When this function returns true, these functions are supported on the device:
12088  - PLIB_DMA_StopInIdleEnable
12089  - PLIB_DMA_StopInIdleDisable
12090  Preconditions:
12091  None.
12092  Parameters:
12093  index - Identifier for the device instance
12094  Returns:
12095  - true - The StopInIdle feature is supported on the device
12096  - false - The StopInIdle feature is not supported on the device
12097  Remarks:
12098  None.
12099 */
12100 
12101 bool
12103  DMA_MODULE_ID index ) ;
12104 //******************************************************************************
12105 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12106  Summary:
12107  Identifies whether the EnableControl feature exists on the DMA module.
12108  Description:
12109  This function identifies whether the EnableControl feature is available on
12110  the DMA module.
12111  When this function returns true, these functions are supported on the device:
12112  - PLIB_DMA_Enable
12113  - PLIB_DMA_Disable
12114  - PLIB_DMA_IsEnabled
12115  Preconditions:
12116  None.
12117  Parameters:
12118  index - Identifier for the device instance
12119  Returns:
12120  - true - The EnableControl feature is supported on the device
12121  - false - The EnableControl feature is not supported on the device
12122  Remarks:
12123  None.
12124 */
12125 
12126 bool
12128  DMA_MODULE_ID index ) ;
12129 //******************************************************************************
12130 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12131  Summary:
12132  Identifies whether the ChannelBits feature exists on the DMA module.
12133  Description:
12134  This function identifies whether the ChannelBits feature is available on the
12135  DMA module.
12136  When this function returns true, this function is supported on the device:
12137  - PLIB_DMA_ChannelBitsGet
12138  Preconditions:
12139  None.
12140  Parameters:
12141  index - Identifier for the device instance
12142  Returns:
12143  - true - The ChannelBits feature is supported on the device
12144  - false - The ChannelBits feature is not supported on the device
12145  Remarks:
12146  None.
12147 */
12148 
12149 bool
12151  DMA_MODULE_ID index ) ;
12152 //******************************************************************************
12153 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12154  Summary:
12155  Identifies whether the LastBusAccess feature exists on the DMA module.
12156  Description:
12157  This function identifies whether the LastBusAccess feature is available on the
12158  DMA module.
12159  When this function returns true, these functions are supported on the device:
12160  - PLIB_DMA_LastBusAccessIsRead
12161  - PLIB_DMA_LastBusAccessIsWrite
12162  Preconditions:
12163  None.
12164  Parameters:
12165  index - Identifier for the device instance
12166  Returns:
12167  - true - The LastBusAccess feature is supported on the device
12168  - false - The LastBusAccess feature is not supported on the device
12169  Remarks:
12170  None.
12171 */
12172 
12173 bool
12175  DMA_MODULE_ID index ) ;
12176 //******************************************************************************
12177 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12178  Summary:
12179  Identifies whether the RecentAddress feature exists on the DMA module.
12180  Description:
12181  This function identifies whether the RecentAddress feature is available on
12182  the DMA module.
12183  When this function returns true, this function is supported on the device:
12184  - PLIB_DMA_RecentAddressAccessed
12185  Preconditions:
12186  None.
12187  Parameters:
12188  index - Identifier for the device instance
12189  Returns:
12190  - true - The RecentAddress feature is supported on the device
12191  - false - The RecentAddress feature is not supported on the device
12192  Remarks:
12193  None.
12194 */
12195 
12196 bool
12198  DMA_MODULE_ID index ) ;
12199 //******************************************************************************
12200 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12201  Summary:
12202  Identifies whether the CRCChannel feature exists on the DMA module.
12203  Description:
12204  This function identifies whether the CRCChannel feature is available on the
12205  DMA module.
12206  When this function returns true, these functions are supported on the device:
12207  - PLIB_DMA_CRCChannelSelect
12208  - PLIB_DMA_CRCChannelGet
12209  Preconditions:
12210  None.
12211  Parameters:
12212  index - Identifier for the device instance
12213  Returns:
12214  - true - The CRCChannel feature is supported on the device
12215  - false - The CRCChannel feature is not supported on the device
12216  Remarks:
12217  None.
12218 */
12219 
12220 bool
12222  DMA_MODULE_ID index ) ;
12223 //******************************************************************************
12224 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12225  Summary:
12226  Identifies whether the CRCType feature exists on the DMA module.
12227  Description:
12228  This function identifies whether the CRCType feature is available on the
12229  DMA module.
12230  When this function returns true, these functions are supported on the device:
12231  - PLIB_DMA_CRCTypeGet
12232  - PLIB_DMA_CRCTypeSet
12233  Preconditions:
12234  None.
12235  Parameters:
12236  index - Identifier for the device instance
12237  Returns:
12238  - true - The CRCType feature is supported on the device
12239  - false - The CRCType feature is not supported on the device
12240  Remarks:
12241  None.
12242 */
12243 
12244 bool
12246  DMA_MODULE_ID index ) ;
12247 //******************************************************************************
12248 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12249  Summary:
12250  Identifies whether the CRCAppendMode feature exists on the DMA module.
12251  Description:
12252  This function identifies whether the CRCAppendMode feature is available on
12253  the DMA module.
12254  When this function returns true, these functions are supported on the device:
12255  - PLIB_DMA_CRCAppendModeEnable
12256  - PLIB_DMA_CRCAppendModeDisable
12257  - PLIB_DMA_CRCAppendModeIsEnabled
12258  Preconditions:
12259  None.
12260  Parameters:
12261  index - Identifier for the device instance
12262  Returns:
12263  - true - The CRCAppendMode feature is supported on the device
12264  - false - The CRCAppendMode feature is not supported on the device
12265  Remarks:
12266  None.
12267 */
12268 
12269 bool
12271  DMA_MODULE_ID index ) ;
12272 //******************************************************************************
12273 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12274  Summary:
12275  Identifies whether the CRC feature exists on the DMA module.
12276  Description:
12277  This function identifies whether the CRC feature is available on the DMA module.
12278  When this function returns true, these functions are supported on the device:
12279  - PLIB_DMA_CRCEnable
12280  - PLIB_DMA_CRCDisable
12281  - PLIB_DMA_CRCIsEnabled
12282  Preconditions:
12283  None.
12284  Parameters:
12285  index - Identifier for the device instance
12286  Returns:
12287  - true - The CRC feature is supported on the device
12288  - false - The CRC feature is not supported on the device
12289  Remarks:
12290  None.
12291 */
12292 
12293 bool
12295  DMA_MODULE_ID index ) ;
12296 //******************************************************************************
12297 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12298  Summary:
12299  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12300  Description:
12301  This function identifies whether the CRCPolynomialLength feature is available
12302  on the DMA module.
12303  When this function returns true, these functions are supported on the device:
12304  - PLIB_DMA_CRCPolynomialLengthSet
12305  - PLIB_DMA_CRCPolynomialLengthGet
12306  Preconditions:
12307  None.
12308  Parameters:
12309  index - Identifier for the device instance
12310  Returns:
12311  - true - The CRCPolynomialLength feature is supported on the device
12312  - false - The CRCPolynomialLength feature is not supported on the device
12313  Remarks:
12314  None.
12315 */
12316 
12317 bool
12319  DMA_MODULE_ID index ) ;
12320 //******************************************************************************
12321 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12322  Summary:
12323  Identifies whether the CRCBitOrder feature exists on the DMA module.
12324  Description:
12325  This function identifies whether the CRCBitOrder feature is available on the
12326  DMA module.
12327  When this function returns true, this function is supported on the device:
12328  - PLIB_DMA_CRCBitOrderSelect
12329  Preconditions:
12330  None.
12331  Parameters:
12332  index - Identifier for the device instance
12333  Returns:
12334  - true - The CRCBitOrder feature is supported on the device
12335  - false - The CRCBitOrder feature is not supported on the device
12336  Remarks:
12337  None.
12338 */
12339 
12340 bool
12342  DMA_MODULE_ID index ) ;
12343 //******************************************************************************
12344 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12345  Summary:
12346  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12347  Description:
12348  This function identifies whether the CRCWriteByteOrder feature is available
12349  on the DMA module.
12350  When this function returns true, these functions are supported on the device:
12351  - PLIB_DMA_CRCWriteByteOrderAlter
12352  - PLIB_DMA_CRCWriteByteOrderMaintain
12353  Preconditions:
12354  None.
12355  Parameters:
12356  index - Identifier for the device instance
12357  Returns:
12358  - true - The CRCWriteByteOrder feature is supported on the device
12359  - false - The CRCWriteByteOrder feature is not supported on the device
12360  Remarks:
12361  None.
12362 */
12363 
12364 bool
12366  DMA_MODULE_ID index ) ;
12367 //******************************************************************************
12368 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12369  Summary:
12370  Identifies whether the CRCByteOrder feature exists on the DMA module.
12371  Description:
12372  This function identifies whether the CRCByteOrder feature is available on
12373  the DMA module.
12374  When this function returns true, these functions are supported on the device:
12375  - PLIB_DMA_CRCByteOrderSelect
12376  - PLIB_DMA_CRCByteOrderGet
12377  Preconditions:
12378  None.
12379  Parameters:
12380  index - Identifier for the device instance
12381  Returns:
12382  - true - The CRCByteOrder feature is supported on the device
12383  - false - The CRCByteOrder feature is not supported on the device
12384  Remarks:
12385  None.
12386 */
12387 
12388 bool
12390  DMA_MODULE_ID index ) ;
12391 //******************************************************************************
12392 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12393  Summary:
12394  Identifies whether the CRCData feature exists on the DMA module.
12395  Description:
12396  This function identifies whether the CRCData feature is available on the
12397  DMA module.
12398  When this function returns true, these functions are supported on the device:
12399  - PLIB_DMA_CRCDataRead
12400  - PLIB_DMA_CRCDataWrite
12401  Preconditions:
12402  None.
12403  Parameters:
12404  index - Identifier for the device instance
12405  Returns:
12406  - true - The CRCData feature is supported on the device
12407  - false - The CRCData feature is not supported on the device
12408  Remarks:
12409  None.
12410 */
12411 
12412 bool
12414  DMA_MODULE_ID index ) ;
12415 //******************************************************************************
12416 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12417  Summary:
12418  Identifies whether the CRCXOREnable feature exists on the DMA module.
12419  Description:
12420  This function identifies whether the CRCXOREnable feature is available on the
12421  DMA module.
12422  When this function returns true, these functions are supported on the device:
12423  - PLIB_DMA_CRCXOREnableSet
12424  - PLIB_DMA_CRCXOREnableGet
12425  Preconditions:
12426  None.
12427  Parameters:
12428  index - Identifier for the device instance
12429  Returns:
12430  - true - The CRCXOREnable feature is supported on the device
12431  - false - The CRCXOREnable feature is not supported on the device
12432  Remarks:
12433  None.
12434 */
12435 
12436 bool
12438  DMA_MODULE_ID index ) ;
12439 //******************************************************************************
12440 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12441  Summary:
12442  Identifies whether the ChannelXPriority feature exists on the DMA module.
12443  Description:
12444  This function identifies whether the ChannelXPriority feature is available on
12445  the DMA module.
12446  When this function returns true, these functions are supported on the device:
12447  - PLIB_DMA_ChannelXPrioritySelect
12448  - PLIB_DMA_ChannelXPriorityGet
12449  Preconditions:
12450  None.
12451  Parameters:
12452  index - Identifier for the device instance
12453  Returns:
12454  - true - The ChannelXPriority feature is supported on the device
12455  - false - The ChannelXPriority feature is not supported on the device
12456  Remarks:
12457  None.
12458 */
12459 
12460 bool
12462  DMA_MODULE_ID index ) ;
12463 //******************************************************************************
12464 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12465  Summary:
12466  Identifies whether the ChannelXEvent feature exists on the DMA module.
12467  Description:
12468  This function identifies whether the ChannelXEvent feature is available on
12469  the DMA module.
12470  When this function returns true, this function is supported on the device:
12471  - PLIB_DMA_ChannelXEventIsDetected
12472  Preconditions:
12473  None.
12474  Parameters:
12475  index - Identifier for the device instance
12476  Returns:
12477  - true - The ChannelXEvent feature is supported on the device
12478  - false - The ChannelXEvent feature is not supported on the device
12479  Remarks:
12480  None.
12481 */
12482 
12483 bool
12485  DMA_MODULE_ID index ) ;
12486 //******************************************************************************
12487 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12488  Summary:
12489  Identifies whether the ChannelXAuto feature exists on the DMA module.
12490  Description:
12491  This function identifies whether the ChannelXAuto feature is available on
12492  the DMA module.
12493  When this function returns true, these functions are supported on the device:
12494  - PLIB_DMA_ChannelXAutoEnable
12495  - PLIB_DMA_ChannelXAutoDisable
12496  - PLIB_DMA_ChannelXAutoIsEnabled
12497  Preconditions:
12498  None.
12499  Parameters:
12500  index - Identifier for the device instance
12501  Returns:
12502  - true - The ChannelXAuto feature is supported on the device
12503  - false - The ChannelXAuto feature is not supported on the device
12504  Remarks:
12505  None.
12506 */
12507 
12508 bool
12510  DMA_MODULE_ID index ) ;
12511 //******************************************************************************
12512 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12513  Summary:
12514  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12515  Description:
12516  This function identifies whether the ChannelXChainEnbl feature is available
12517  on the DMA module.
12518  When this function returns true, these functions are supported on the device:
12519  - PLIB_DMA_ChannelXChainEnable
12520  - PLIB_DMA_ChannelXChainDisable
12521  - PLIB_DMA_ChannelXChainIsEnabled
12522  Preconditions:
12523  None.
12524  Parameters:
12525  index - Identifier for the device instance
12526  Returns:
12527  - true - The ChannelXChainEnbl feature is supported on the device
12528  - false - The ChannelXChainEnbl feature is not supported on the device
12529  Remarks:
12530  None.
12531 */
12532 
12533 bool
12535  DMA_MODULE_ID index ) ;
12536 //******************************************************************************
12537 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12538  Summary:
12539  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12540  Description:
12541  This function identifies whether the ChannelXDisabled feature is available
12542  on the DMA module.
12543  When this function returns true, these functions are supported on the device:
12544  - PLIB_DMA_ChannelXDisabledEnablesEvents
12545  - PLIB_DMA_ChannelXDisabledDisablesEvents
12546  Preconditions:
12547  None.
12548  Parameters:
12549  index - Identifier for the device instance
12550  Returns:
12551  - true - The ChannelXDisabled feature is supported on the device
12552  - false - The ChannelXDisabled feature is not supported on the device
12553  Remarks:
12554  None.
12555 */
12556 
12557 bool
12559  DMA_MODULE_ID index ) ;
12560 //******************************************************************************
12561 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12562  Summary:
12563  Identifies whether the ChannelX feature exists on the DMA module.
12564  Description:
12565  This function identifies whether the ChannelX feature is available on the
12566  DMA module.
12567  When this function returns true, these functions are supported on the device:
12568  - PLIB_DMA_ChannelXEnable
12569  - PLIB_DMA_ChannelXIsEnabled
12570  - PLIB_DMA_ChannelXDisable
12571  Preconditions:
12572  None.
12573  Parameters:
12574  index - Identifier for the device instance
12575  Returns:
12576  - true - The ChannelX feature is supported on the device
12577  - false - The ChannelX feature is not supported on the device
12578  Remarks:
12579  None.
12580 */
12581 
12582 bool
12584  DMA_MODULE_ID index ) ;
12585 //******************************************************************************
12586 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12587  Summary:
12588  Identifies whether the ChannelXChain feature exists on the DMA module.
12589  Description:
12590  This function identifies whether the ChannelXChain feature is available on the
12591  DMA module.
12592  When this function returns true, these functions are supported on the device:
12593  - PLIB_DMA_ChannelXChainToLower
12594  - PLIB_DMA_ChannelXChainToHigher
12595  Preconditions:
12596  None.
12597  Parameters:
12598  index - Identifier for the device instance
12599  Returns:
12600  - true - The ChannelXChain feature is supported on the device
12601  - false - The ChannelXChain feature is not supported on the device
12602  Remarks:
12603  None.
12604 */
12605 
12606 bool
12608  DMA_MODULE_ID index ) ;
12609 //******************************************************************************
12610 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12611  Summary:
12612  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12613  Description:
12614  This function identifies whether the ChannelXPatternLength feature is available
12615  on the DMA module.
12616  When this function returns true, these functions are supported on the device:
12617  - PLIB_DMA_ChannelXPatternLengthSet
12618  - PLIB_DMA_ChannelXPatternLengthGet
12619  Preconditions:
12620  None.
12621  Parameters:
12622  index - Identifier for the device instance
12623  Returns:
12624  - true - The ChannelXPatternLength feature is supported on the device
12625  - false - The ChannelXPatternLength feature is not supported on the device
12626  Remarks:
12627  None.
12628 */
12629 
12630 bool
12632  DMA_MODULE_ID index ) ;
12633 //******************************************************************************
12634 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12635  Summary:
12636  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12637  module.
12638  Description:
12639  This function identifies whether the ChannelXPatternIgnoreByte feature is
12640  available on the DMA module.
12641  When this function returns true, these functions are supported on the device:
12642  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12643  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12644  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12645  Preconditions:
12646  None.
12647  Parameters:
12648  index - Identifier for the device instance
12649  Returns:
12650  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12651  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12652  Remarks:
12653  None.
12654 */
12655 
12656 bool
12658  DMA_MODULE_ID index ) ;
12659 //******************************************************************************
12660 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12661  Summary:
12662  Identifies whether the ChannelXBusy feature exists on the DMA module.
12663  Description:
12664  This function identifies whether the ChannelXBusy feature is available on the
12665  DMA module.
12666  When this function returns true, these functions are supported on the device:
12667  - PLIB_DMA_ChannelXBusyActiveSet
12668  - PLIB_DMA_ChannelXBusyInActiveSet
12669  - PLIB_DMA_ChannelXBusyIsBusy
12670  Preconditions:
12671  None.
12672  Parameters:
12673  index - Identifier for the device instance
12674  Returns:
12675  - true - The ChannelXBusy feature is supported on the device
12676  - false - The ChannelXBusy feature is not supported on the device
12677  Remarks:
12678  None.
12679 */
12680 
12681 bool
12683  DMA_MODULE_ID index ) ;
12684 //******************************************************************************
12685 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12686  Summary:
12687  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12688  Description:
12689  This function identifies whether the ChannelXPatternIgnore feature is available
12690  on the DMA module.
12691  When this function returns true, these functions are supported on the device:
12692  - PLIB_DMA_ChannelXPatternIgnoreSet
12693  - PLIB_DMA_ChannelXPatternIgnoreGet
12694  Preconditions:
12695  None.
12696  Parameters:
12697  index - Identifier for the device instance
12698  Returns:
12699  - true - The ChannelXPatternIgnore feature is supported on the device
12700  - false - The ChannelXPatternIgnore feature is not supported on the device
12701  Remarks:
12702  None.
12703 */
12704 
12705 bool
12707  DMA_MODULE_ID index ) ;
12708 //******************************************************************************
12709 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12710  Summary:
12711  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12712  Description:
12713  This function identifies whether the ChannelXTrigger feature is available on
12714  the DMA module.
12715  When this function returns true, these functions are supported on the device:
12716  - PLIB_DMA_ChannelXTriggerEnable
12717  - PLIB_DMA_ChannelXTriggerIsEnabled
12718  - PLIB_DMA_ChannelXTriggerDisable
12719  Preconditions:
12720  None.
12721  Parameters:
12722  index - Identifier for the device instance
12723  Returns:
12724  - true - The ChannelXTrigger feature is supported on the device
12725  - false - The ChannelXTrigger feature is not supported on the device
12726  Remarks:
12727  None.
12728 */
12729 
12730 bool
12732  DMA_MODULE_ID index ) ;
12733 //******************************************************************************
12734 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12735  Summary:
12736  Identifies whether the AbortTransfer feature exists on the DMA module.
12737  Description:
12738  This function identifies whether the AbortTransfer feature is available on
12739  the DMA module.
12740  When this function returns true, this function is supported on the device:
12741  - PLIB_DMA_AbortTransferSet
12742  Preconditions:
12743  None.
12744  Parameters:
12745  index - Identifier for the device instance
12746  Returns:
12747  - true - The AbortTransfer feature is supported on the device
12748  - false - The AbortTransfer feature is not supported on the device
12749  Remarks:
12750  None.
12751 */
12752 
12753 bool
12755  DMA_MODULE_ID index ) ;
12756 //******************************************************************************
12757 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12758  Summary:
12759  Identifies whether the StartTransfer feature exists on the DMA module.
12760  Description:
12761  This function identifies whether the StartTransfer feature is available on
12762  the DMA module.
12763  When this function returns true, this function is supported on the device:
12764  - PLIB_DMA_StartTransferSet
12765  Preconditions:
12766  None.
12767  Parameters:
12768  index - Identifier for the device instance
12769  Returns:
12770  - true - The StartTransfer feature is supported on the device
12771  - false - The StartTransfer feature is not supported on the device
12772  Remarks:
12773  None.
12774 */
12775 
12776 bool
12778  DMA_MODULE_ID index ) ;
12779 //******************************************************************************
12780 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12781  Summary:
12782  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12783  Description:
12784  This function identifies whether the ChannelXStartIRQ feature is available
12785  on the DMA module.
12786  When this function returns true, this function is supported on the device:
12787  - PLIB_DMA_ChannelXStartIRQSet
12788  Preconditions:
12789  None.
12790  Parameters:
12791  index - Identifier for the device instance
12792  Returns:
12793  - true - The ChannelXStartIRQ feature is supported on the device
12794  - false - The ChannelXStartIRQ feature is not supported on the device
12795  Remarks:
12796  None.
12797 */
12798 
12799 bool
12801  DMA_MODULE_ID index ) ;
12802 //******************************************************************************
12803 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12804  Summary:
12805  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12806  Description:
12807  This function identifies whether the ChannelXAbortIRQ feature is available
12808  on the DMA module.
12809  When this function returns true, this function is supported on the device:
12810  - PLIB_DMA_ChannelXAbortIRQSet
12811  Preconditions:
12812  None.
12813  Parameters:
12814  index - Identifier for the device instance
12815  Returns:
12816  - true - The ChannelXAbortIRQ feature is supported on the device
12817  - false - The ChannelXAbortIRQ feature is not supported on the device
12818  Remarks:
12819  None.
12820 */
12821 
12822 bool
12824  DMA_MODULE_ID index ) ;
12825 //******************************************************************************
12826 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12827  Summary:
12828  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12829  Description:
12830  This function identifies whether the ChannelXINTSourceFlag feature is available
12831  on the DMA module.
12832  When this function returns true, these functions are supported on the device:
12833  - PLIB_DMA_ChannelXINTSourceFlagGet
12834  - PLIB_DMA_ChannelXINTSourceFlagSet
12835  - PLIB_DMA_ChannelXINTSourceFlagClear
12836  Preconditions:
12837  None.
12838  Parameters:
12839  index - Identifier for the device instance
12840  Returns:
12841  - true - The ChannelXINTSourceFlag feature is supported on the device
12842  - false - The ChannelXINTSourceFlag feature is not supported on the device
12843  Remarks:
12844  None.
12845 */
12846 
12847 bool
12849  DMA_MODULE_ID index ) ;
12850 //******************************************************************************
12851 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12852  Summary:
12853  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12854  Description:
12855  This function identifies whether the ChannelXINTSource feature is available
12856  on the DMA module.
12857  When this function returns true, these functions are supported on the device:
12858  - PLIB_DMA_ChannelXINTSourceEnable
12859  - PLIB_DMA_ChannelXINTSourceDisable
12860  - PLIB_DMA_ChannelXINTSourceIsEnabled
12861  Preconditions:
12862  None.
12863  Parameters:
12864  index - Identifier for the device instance
12865  Returns:
12866  - true - The ChannelXINTSource feature is supported on the device
12867  - false - The ChannelXINTSource feature is not supported on the device
12868  Remarks:
12869  None.
12870 */
12871 
12872 bool
12874  DMA_MODULE_ID index ) ;
12875 //******************************************************************************
12876 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12877  Summary:
12878  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12879  Description:
12880  This function identifies whether the ChannelXSourceStartAddress feature is available
12881  on the DMA module.
12882  When this function returns true, these functions are supported on the device:
12883  - PLIB_DMA_ChannelXSourceStartAddressGet
12884  - PLIB_DMA_ChannelXSourceStartAddressSet
12885  Preconditions:
12886  None.
12887  Parameters:
12888  index - Identifier for the device instance
12889  Returns:
12890  - true - The ChannelXSourceStartAddress feature is supported on the device
12891  - false - The ChannelXSourceStartAddress feature is not supported on the device
12892  Remarks:
12893  None.
12894 */
12895 
12896 bool
12898  DMA_MODULE_ID index ) ;
12899 //******************************************************************************
12900 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12901  Summary:
12902  Identifies whether the ChannelXDestinationStartAddress feature exists on
12903  the DMA module.
12904  Description:
12905  This function identifies whether the ChannelXDestinationStartAddress feature
12906  is available on the DMA module.
12907  When this function returns true, these functions are supported on the device:
12908  - PLIB_DMA_ChannelXDestinationStartAddressGet
12909  - PLIB_DMA_ChannelXDestinationStartAddressSet
12910  Preconditions:
12911  None.
12912  Parameters:
12913  index - Identifier for the device instance
12914  Returns:
12915  - true - The ChannelXDestinationStartAddress feature is supported on the device
12916  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12917  Remarks:
12918  None.
12919 */
12920 
12921 bool
12923  DMA_MODULE_ID index ) ;
12924 //******************************************************************************
12925 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12926  Summary:
12927  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12928  Description:
12929  This function identifies whether the ChannelXSourceSize feature is available
12930  on the DMA module.
12931  When this function returns true, these functions are supported on the device:
12932  - PLIB_DMA_ChannelXSourceSizeGet
12933  - PLIB_DMA_ChannelXSourceSizeSet
12934  Preconditions:
12935  None.
12936  Parameters:
12937  index - Identifier for the device instance
12938  Returns:
12939  - true - The ChannelXSourceSize feature is supported on the device
12940  - false - The ChannelXSourceSize feature is not supported on the device
12941  Remarks:
12942  None.
12943 */
12944 
12945 bool
12947  DMA_MODULE_ID index ) ;
12948 //******************************************************************************
12949 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12950  Summary:
12951  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12952  Description:
12953  This function identifies whether the ChannelXDestinationSize feature is available
12954  on the DMA module.
12955  When this function returns true, these functions are supported on the device:
12956  - PLIB_DMA_ChannelXDestinationSizeGet
12957  - PLIB_DMA_ChannelXDestinationSizeSet
12958  Preconditions:
12959  None.
12960  Parameters:
12961  index - Identifier for the device instance
12962  Returns:
12963  - true - The ChannelXDestinationSize feature is supported on the device
12964  - false - The ChannelXDestinationSize feature is not supported on the device
12965  Remarks:
12966  None.
12967 */
12968 
12969 bool
12971  DMA_MODULE_ID index ) ;
12972 //******************************************************************************
12973 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12974  Summary:
12975  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12976  Description:
12977  This function identifies whether the ChannelXSourcePointer feature is available
12978  on the DMA module.
12979  When this function returns true, this function is supported on the device:
12980  - PLIB_DMA_ChannelXSourcePointerGet
12981  Preconditions:
12982  None.
12983  Parameters:
12984  index - Identifier for the device instance
12985  Returns:
12986  - true - The ChannelXSourcePointer feature is supported on the device
12987  - false - The ChannelXSourcePointer feature is not supported on the device
12988  Remarks:
12989  None.
12990 */
12991 
12992 bool
12994  DMA_MODULE_ID index ) ;
12995 //******************************************************************************
12996 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
12997  Summary:
12998  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
12999  Description:
13000  This function identifies whether the ChannelXDestinationPointer feature is available
13001  on the DMA module.
13002  When this function returns true, this function is supported on the device:
13003  - PLIB_DMA_ChannelXDestinationPointerGet
13004  Preconditions:
13005  None.
13006  Parameters:
13007  index - Identifier for the device instance
13008  Returns:
13009  - true - The ChannelXDestinationPointer feature is supported on the device
13010  - false - The ChannelXDestinationPointer feature is not supported on the device
13011  Remarks:
13012  None.
13013 */
13014 
13015 bool
13017  DMA_MODULE_ID index ) ;
13018 //******************************************************************************
13019 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13020  Summary:
13021  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13022  Description:
13023  This function identifies whether the ChannelXCellSize feature is available on
13024  the DMA module.
13025  When this function returns true, these functions are supported on the device:
13026  - PLIB_DMA_ChannelXCellSizeGet
13027  - PLIB_DMA_ChannelXCellSizeSet
13028  Preconditions:
13029  None.
13030  Parameters:
13031  index - Identifier for the device instance
13032  Returns:
13033  - true - The ChannelXCellSize feature is supported on the device
13034  - false - The ChannelXCellSize feature is not supported on the device
13035  Remarks:
13036  None.
13037 */
13038 
13039 bool
13041  DMA_MODULE_ID index ) ;
13042 //******************************************************************************
13043 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13044  Summary:
13045  Identifies whether the ChannelXCellProgressPointer feature exists on the
13046  DMA module.
13047  Description:
13048  This function identifies whether the ChannelXCellProgressPointer feature is
13049  available on the DMA module.
13050  When this function returns true, this function is supported on the device:
13051  - PLIB_DMA_ChannelXCellProgressPointerGet
13052  Preconditions:
13053  None.
13054  Parameters:
13055  index - Identifier for the device instance
13056  Returns:
13057  - true - The ChannelXCellProgressPointer feature is supported on the device
13058  - false - The ChannelXCellProgressPointer feature is not supported on the device
13059  Remarks:
13060  None.
13061 */
13062 
13063 bool
13065  DMA_MODULE_ID index ) ;
13066 //******************************************************************************
13067 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13068  Summary:
13069  Identifies whether the ChannelXPatternData feature exists on the DMA module
13070  Description:
13071  This function identifies whether the ChannelXPatternData feature is available
13072  on the DMA module.
13073  When this function returns true, these functions are supported on the device:
13074  - PLIB_DMA_ChannelXPatternDataGet
13075  - PLIB_DMA_ChannelXPatternDataSet
13076  Preconditions:
13077  None.
13078  Parameters:
13079  index - Identifier for the device instance
13080  Returns:
13081  - true - The ChannelXPatternData feature is supported on the device
13082  - false - The ChannelXPatternData feature is not supported on the device
13083  Remarks:
13084  None.
13085 */
13086 
13087 bool
13089  DMA_MODULE_ID index ) ;
13090 //DOM-IGNORE-BEGIN
13091 //DOM-IGNORE-END
13092  // #ifndef _PLIB_DMA_H
13093 /*******************************************************************************
13094  End of File
13095 */
13096 
13097 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13098 /* CLOSE_FILE Include File */
13099 
13100 // *****************************************************************************
13101 // *****************************************************************************
13102 // Section: Data Types
13103 // *****************************************************************************
13104 // *****************************************************************************
13105 // *****************************************************************************
13106 /* DMA System Service Channel None
13107  Summary:
13108  DMA channel none
13109  Description:
13110  This constant identifies the specification of no choice from client
13111  for allocating a particular DMA channel.
13112  Remarks:
13113  This constant should be used in place of hard-coded numeric literals.
13114 */
13115 //DOM-IGNORE-BEGIN
13116 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13117 //DOM-IGNORE-END
13118 // *****************************************************************************
13119 /* DMA System Service Channel Any
13120  Summary:
13121  Identifies the client specification to allocate any available DMA channel.
13122  Description:
13123  This constant identifies the specification by the client
13124  to allocate any available DMA channel.
13125  Remarks:
13126  This constant should be used in place of hard-coded numeric literals.
13127 */
13128 //DOM-IGNORE-BEGIN
13129 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13130 //DOM-IGNORE-END
13131 // *****************************************************************************
13132 /* DMA System Service Channel Count
13133  Summary:
13134  Identifies the maximum number of DMA channel handles to be defined.
13135  Description:
13136  This constant identifies the maximum number of DMA channel handles
13137  that should be defined.
13138  Remarks:
13139  This value is derived from device-specific header files defined as
13140  part of the peripheral libraries.
13141 */
13142 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13143 // *****************************************************************************
13144 /* DMA System Service Channel Handle
13145  Summary:
13146  Assigns the handle for requested channel.
13147  Description:
13148  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13149  function. This handle is associated with the channel number that is used for
13150  data transfer and it allows the application to track the data transfer.
13151  The channel handle once assigned to a client expires when the
13152  client calls SYS_DMA_ChannelRelease.
13153  exits.
13154  Remarks:
13155  None.
13156 */
13157 
13158 typedef
13159 uintptr_t
13161 // *****************************************************************************
13162 /* DMA System Service Invalid Channel Handle
13163  Summary:
13164  Defines an invalid channel handle.
13165  Description:
13166  This is the definition of an invalid channel handle. An invalid buffer handle
13167  is returned by SYS_DMA_ChannelAllocate function if the channel number
13168  request was not successful.
13169  Remarks:
13170  None.
13171 */
13172 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13173 // *****************************************************************************
13174 /* DMA stop in idle mode
13175  Summary:
13176  Enable/Disable DMA operations in Idle mode.
13177  Description:
13178  This data type allows enabling/disabling of DMA operations in idle mode.
13179  Remarks:
13180  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13181  while initializing the DMA module by calling SYS_DMA_Initialize.
13182  This feature may not be available on all devices. Refer to the specific device
13183  data sheet to determine availability.
13184 */
13185 
13186 typedef
13187  enum
13188  {
13189  /* When the CPU enters idle mode, the DMA module continue operations */
13191  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13193  } SYS_DMA_SIDL ;
13194 // *****************************************************************************
13195 /* DMA Channel chaining priority
13196  Summary:
13197  Identifies the priority of chaining channel.
13198  Description:
13199  This data type identifies the priority of chaining channel.
13200  Channel chaining priority identifies the channel that will be enabled
13201  on completion of block data transfer on the master channel.
13202  Remarks:
13203  None.
13204 */
13205 
13206 typedef
13207  enum
13208  {
13209  /* Chain to channel higher in natural priority */
13211  /* Chain to channel lower in natural priority */
13214 // *****************************************************************************
13215 /* DMA Channel ignore pattern match
13216  Summary:
13217  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13218  pattern.
13219  Description:
13220  This data type allows enabling/disabling the feature to ignore a byte
13221  between a 2-byte match abort pattern.
13222  Remarks:
13223  This feature may not be available on all devices. Refer to the specific device
13224  data sheet to determine availability.
13225 */
13226 
13227 typedef
13228  enum
13229  {
13230  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13232  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13235 // *****************************************************************************
13236 /* DMA channel CRC mode
13237  Summary:
13238  Identifies the operation mode of the CRC module.
13239  Description:
13240  This data type identifies CRC operating mode. The CRC computation can be
13241  in background mode or append mode.
13242  Remarks:
13243  None.
13244 */
13245 
13246 typedef
13247  enum
13248  {
13249  /* DMA reads the data from the source, passes it through the CRC module and
13250  writes it to the destination. the calculated CRC is left in the DCRCDATA
13251  register at the end of the block transfer. */
13253  /* DMA only feeds source data to the CRC module. it does not write source data
13254  to the destination address. When a block transfer complete or pattern abort
13255  event occur, The DMA writes the CRC value to the destination address */
13258 // *****************************************************************************
13259 /* DMA channel CRC write order
13260  Summary:
13261  Identifies altering/maintaining write order post CRC computation.
13262  Description:
13263  This data type identifies write byte order selection post CRC
13264  computation.
13265  Remarks:
13266  None.
13267 */
13268 
13269 typedef
13270  enum
13271  {
13272  /* Source data is written to the destination unchanged regardless
13273  of the selected pre-CRC byte order. */
13275  /* Source data is written to the destination reordered according
13276  to the selected pre-CRC byte order. */
13279 // *****************************************************************************
13280 /* DMA channel operation modes
13281  Summary:
13282  Identifies the available DMA operating modes.
13283  Description:
13284  This data type Identifies the available DMA operating modes.
13285  The supported DMA modes are not mutually exclusive, but can be simultaneously
13286  operational.
13287  Remarks:
13288  These supported DMA modes can be logically OR'd together. They are passed
13289  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13290 */
13291 
13292 typedef
13293  enum
13294  {
13295  /* The normal DMA operation mode. The DMA channel will transfer data from
13296  a source to a destination without CPU intervention */
13297  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13298  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13299  ,
13300  /* Pattern Match abort mode allows the user to end a transfer if data
13301  written during a transaction matches a specific pattern, as defined by
13302  the DCHxDAT register */
13304  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13305  ,
13306  /* Channel chaining operating mode enhances the normal DMA channel
13307  operations. A channel(slave) can be chained to an adjacent channel(master).
13308  The slave channel will be enabled when a block transfer of the master
13309  channel completes. */
13310  /* only one of the below two chaining priorities must be provided.
13311  Chaining priority High. */
13313  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13314  ,
13315  /* Chaining priority Low */
13317  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13318  ,
13319  /* Auto enable operating mode allows a channel to be kept active, even if a
13320  block transfer completes or pattern match occurs. This prevents the user
13321  from having to re-enable the channel each time a block transfer completes. */
13322  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13323  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13324  ,
13325  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13326  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13327  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13329 // *****************************************************************************
13330 /* DMA channel CRC mode
13331  Summary:
13332  Defines the attributes for CRC operation mode.
13333  Description:
13334  This data type defines the attributes for CRC operation mode.
13335  Remarks:
13336  This feature may not be available on all devices. Refer to the specific device
13337  data sheet to determine availability.
13338 */
13339 
13340 typedef
13341  struct
13342  {
13343  /* CRC type (PLIB-level).
13344  Type Selection identifies whether the CRC module will calculate an IP
13345  header checksum or an LFSR CRC */
13346  DMA_CRC_TYPE type ;
13347  /* CRC mode, Background or Append */
13349  /* Polynomial length, This value is redundant when the selected CRC type is
13350  IP header checksum. When the CRC type is LFSR, Identifies the length of
13351  the polynomial. */
13352  uint8_t polyLength ;
13353  /* Bit order (PLIB-level).
13354  Identifies whether the CRC is computed LSb or MSb first */
13355  DMA_CRC_BIT_ORDER bitOrder ;
13356  /* Byte order (PLIB-level).
13357  Identifies the byte selection order input pre-CRC Generator. */
13358  DMA_CRC_BYTE_ORDER byteOrder ;
13359  /* Post CRC Write order */
13360  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13361  /* CRC data feed: While enabling the CRC mode, this field gives
13362  the seed for the CRC computation. On block transfer complete or
13363  pattern match abort the field have the computed CRC. */
13364  uint32_t data ;
13365  /* XOR bit mask, This value is redundant when the selected CRC type is
13366  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13367  bit mask input to the shift register during CRC computation. */
13368  uint32_t xorBitMask ;
13370 // *****************************************************************************
13371 /* DMA System service Events
13372  Summary:
13373  Enumeration of possible DMA System service events.
13374  Description:
13375  This data type provides an enumeration of all possible DMA System service events.
13376  Remarks:
13377  None.
13378 */
13379 
13380 typedef
13381  enum
13382  {
13383  /* Data was transferred successfully. */
13385  /* Error while processing the request */
13387  /* Data transfer was aborted. */
13389  /* No events yet. */
13392 // *****************************************************************************
13393 /* DMA System service Error
13394  Summary:
13395  Indicates the error information for the DMA System service.
13396  Description:
13397  This enumeration indicates the error information for the DMA System service.
13398  Remarks:
13399  None.
13400 */
13401 
13402 typedef
13403  enum
13404  {
13405  /* Data was transferred successfully. */
13406  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13407  = 1 << 0 ,
13408  /* DOM-IGNORE-END*/
13409  /* DMA address error. */
13410  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13411  = 1 << 1 /* DOM-IGNORE-END*/
13412  } SYS_DMA_ERROR ;
13413 // *****************************************************************************
13414 /* DMA Initialization data
13415  Summary:
13416  Defines the data required to initialize the DMA subsystem.
13417  Description:
13418  This data type defines the data required to initialize the DMA subsystem.
13419  Remarks:
13420  This feature may not be available on all devices. Refer to the specific device
13421  data sheet to determine availability.
13422 */
13423 
13424 typedef
13425  struct
13426  {
13427  /* Enable/Disable stop in idle mode feature */
13428  SYS_DMA_SIDL sidl ;
13429  } SYS_DMA_INIT ;
13430 // *****************************************************************************
13431 /* Data width options */
13432 
13433 typedef
13434  enum
13435  {
13436  /* Data width configuration feature is not available */
13438  } SYS_DMA_DATA_WIDTH ;
13439 // *****************************************************************************
13440 /* DMA descriptor control
13441  Summary:
13442  Defines the descriptor control for linked list operation.
13443  Description:
13444  This data type defines the descriptor control for linked list operation.
13445  Remarks:
13446  This feature may not be available on all devices. Refer to the specific device
13447  data sheet to determine availability.
13448 */
13449 
13450 typedef
13451  union
13452  {
13453  /* Feature is not supported */
13454  ;
13456 // *****************************************************************************
13457 // *****************************************************************************
13458 // Section: Initialization and Task Functions
13459 // *****************************************************************************
13460 // *****************************************************************************
13461 //******************************************************************************
13462 /* Function:
13463  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13464  Summary:
13465  Maintains the system service's state machine.
13466 
13467  Description:
13468  This function is used to maintain the DMA system service's internal state
13469  machine. This function services events on a specific DMA channel.
13470  Precondition:
13471  DMA should have been initialized by calling SYS_DMA_Initialize.
13472  Parameters:
13473  object - Object handle for the DMA module (returned from
13474  SYS_DMA_Initialize)
13475  activeChannel - DMA channel number to be serviced.
13476  Returns:
13477  None.
13478  Example:
13479  <code>
13480  // 'object' Returned from SYS_DMA_Initialize
13481  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13482  {
13483  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13484  }
13485  </code>
13486  Remarks:
13487  This function is normally not called directly by an application. It is
13488  called by the system's task/interrupt routines.
13489  */
13490 
13491 void
13492  SYS_DMA_Tasks (
13493  SYS_MODULE_OBJ object ,
13494  DMA_CHANNEL activeChannel ) ;
13495 //******************************************************************************
13496 /* For backward compatibility */
13497 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13498  // #ifndef _SYS_DMA_DEFINITIONS_H
13499 /*******************************************************************************
13500  End of File
13501 */
13502 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13503 /* CLOSE_FILE Include File */
13504 
13505 // DOM-IGNORE-BEGIN
13506 // DOM-IGNORE-END
13507 // *****************************************************************************
13508 // *****************************************************************************
13509 // Section: DMA System Service Interface Routines
13510 // *****************************************************************************
13511 // *****************************************************************************
13512 // *****************************************************************************
13513 /* DMA System service Transfer Event Handler Function
13514  Summary:
13515  Pointer to a DMA System service Transfer Event handler function.
13516  Description:
13517  This data type defines a DMA System service Transfer Event Handler Function.
13518  A DMA system service client must register an transfer event handler function of
13519  this type to receive transfer related events from the system service.
13520  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13521  was transferred successfully. The channelHandle parameter contains the channel
13522  handle of the channel on which the transfer was processed.
13523  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13524  not transferred successfully. TThe channelHandle parameter contains the channel
13525  handle of the channel on which the transfer had failed.
13526  The contextHandle parameter contains the context handle that was provided by
13527  the client at the time of registering the event handler. This context handle
13528  can be anything that the client consider helpful or necessary to identify
13529  the client context object associated with the channel of the system
13530  service that generated the event.
13531  The event handler function executes in an interrupt context when DMA is setup
13532  to start operation by an interrupt trigger source. It is recommended of the
13533  application to not perform process intensive operations with in this
13534  function.
13535  Remarks:
13536  None.
13537 */
13538 
13539 typedef
13541 SYS_DMA_CHANNEL_HANDLE handle ,
13542 uintptr_t contextHandle ) ;
13543 // *****************************************************************************
13544 // *****************************************************************************
13545 // Section: Initialization and Task Functions
13546 // *****************************************************************************
13547 // *****************************************************************************
13548 //******************************************************************************
13549 /* Function:
13550  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13551  Summary:
13552  Initializes and Enables the DMA Controller.
13553  Description:
13554  This function Enables the DMA module. Enable/Disable stop in idle mode
13555  feature based on the passed parameter value.
13556  This function initializes the DMA module making it ready for clients to
13557  open and use it. The initialization data is specified by the init parameter.
13558  Precondition:
13559  None.
13560  Parameters:
13561  init - Pointer to the data structure containing any data
13562  necessary to initialize the hardware. This pointer may
13563  be null if no data is required and default
13564  initialization is to be used.
13565  Returns:
13566  If successful, returns a valid handle to the DMA module object.
13567  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13568  Example:
13569  <code>
13570  SYS_MODULE_OBJ objectHandle;
13571  SYS_DMA_INIT initParam;
13572  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13573  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13574  (SYS_MODULE_INIT*)initParam);
13575  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13576  {
13577  // Handle error
13578  }
13579  </code>
13580  Remarks:
13581  This function must be called before any other DMA systems service routines
13582  are called.
13583  Not all features are available on all micro-controllers.
13584 */
13585 
13586 SYS_MODULE_OBJ
13588  const SYS_MODULE_INIT * const init ) ;
13589 // *****************************************************************************
13590 // *****************************************************************************
13591 // Section: Channel Setup and management functions
13592 // *****************************************************************************
13593 // *****************************************************************************
13594 //******************************************************************************
13595 /* Function:
13596  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13597  Summary:
13598  Allocates the specified DMA channel and returns a handle to it.
13599  Description:
13600  This function opens the specified DMA channel and provides a
13601  handle that must be provided to all other client-level operations to
13602  identify the caller and the DMA channel.
13603  Precondition:
13604  Function SYS_DMA_Initialize must have been called before calling this
13605  function.
13606  Parameters:
13607  channel - Channel number requested for allocation.
13608  When channel number specified is DMA_CHANNEL_ANY
13609  a random channel is allocated for DMA transfers.
13610  Returns:
13611  The channel handle for the requested channel number.
13612  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13613  Error can occur.
13614  - if the requested channel number is invalid.
13615  - if the requested channel number is not free.
13616  Example:
13617  <code>
13618  DMA_CHANNEL channel;
13619  SYS_DMA_CHANNEL_HANDLE handle
13620  channel = DMA_CHANNEL_2;
13621  handle = SYS_DMA_ChannelAllocate(channel);
13622  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13623  {
13624  // Failed to allocate the channel
13625  }
13626  else
13627  {
13628  // Proceed with setting up the channel and adding the transfer
13629  }
13630  </code>
13631  Remarks:
13632  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13633  This function must be called before any other DMA channel Setup and management
13634  routines are called
13635 */
13636 
13639  DMA_CHANNEL channel ) ;
13640 //******************************************************************************
13641 /* Function:
13642  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13643  Summary:
13644  Deallocates and frees the channel specified by the handle.
13645  Description:
13646  This function deallocates an allocated-channel of the DMA module,
13647  invalidating the handle.
13648  Precondition:
13649  DMA should have been initialized by calling SYS_DMA_Initialize.
13650  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13651  Parameters:
13652  handle - A valid allocated-channel handle, returned from the service's
13653  Allocate routine
13654  Returns:
13655  None.
13656  Example:
13657  <code>
13658  DMA_CHANNEL channel;
13659  SYS_DMA_CHANNEL_HANDLE handle;
13660  channel = DMA_CHANNEL_2;
13661  handle = SYS_DMA_ChannelAllocate(channel);
13662  SYS_DMA_ChannelRelease(handle);
13663  </code>
13664  Remarks:
13665  After calling this routine, the handle passed in "handle" must not be used
13666  with any of the remaining service's routines. A new handle must be obtained by
13667  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13668 */
13669 
13670 void
13672  SYS_DMA_CHANNEL_HANDLE handle ) ;
13673 //******************************************************************************
13674 /* Function:
13675  void SYS_DMA_ChannelSetup
13676  (
13677  SYS_DMA_CHANNEL_HANDLE handle,
13678  SYS_DMA_CHANNEL_OP_MODE modeEnable
13679  DMA_TRIGGER_SOURCE eventSrc
13680  )
13681  Summary:
13682  Setup the DMA channel parameters.
13683  Description:
13684  This function sets up the DMA channel parameters.
13685  It sets the channel priority and enables the mode of operations for the
13686  current system design.
13687  Precondition:
13688  DMA should have been initialized by calling SYS_DMA_Initialize.
13689  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13690  Parameters:
13691  handle - Handle of the DMA channel as returned by the
13692  SYS_DMA_ChannelAllocate function.
13693  priority - The priority to be associated to the channel.
13694  modeEnable - The supported operating modes to be enabled.
13695  This parameter can be logically ORed to specify
13696  multiple options.
13697  eventSrc - The event causing the cell transfer start.
13698  Returns:
13699  None.
13700  Example:
13701  <code>
13702  // 'handle' is a valid handle returned
13703  // by the SYS_DMA_ChannelAllocate function.
13704  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13705  DMA_TRIGGER_SOURCE eventSrc;
13706  channel = DMA_CHANNEL_2;
13707  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13708  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13709  // Setup channel number, and enables basic and CRC mode
13710  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13711  </code>
13712  Remarks:
13713  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13714  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13715  mode setup API's needs to be called to set the related parameters.
13716  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13717  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13718  Not all features are available on all microcontrollers.
13719  */
13720 
13721 void
13723  SYS_DMA_CHANNEL_HANDLE handle ,
13724  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13725  DMA_TRIGGER_SOURCE eventSrc ) ;
13726 //******************************************************************************
13727 /* Function:
13728  void SYS_DMA_ChannelSetupMatchAbortMode
13729  (
13730  SYS_DMA_CHANNEL_HANDLE handle,
13731  uint16_t pattern,
13732  DMA_PATTERN_LENGTH length,
13733  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13734  uint8_t ignorePattern
13735  )
13736  Summary:
13737  Setup the pattern match abort mode.
13738  Description:
13739  This function sets up the termination of DMA operation when the specified
13740  pattern is matched. Additionally on supported parts the function also
13741  sets up the ignoring of part of a pattern(8-bit) from match abort
13742  pattern(16-bit).
13743  Precondition:
13744  DMA should have been initialized by calling SYS_DMA_Initialize.
13745  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13746  The function SYS_DMA_ChannelSetup must be called to enable
13747  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13748  match mode features.
13749  Parameters:
13750  handle - Handle of the DMA channel as returned by the
13751  SYS_DMA_ChannelAllocate function.
13752  pattern - The pattern that needs to be matched to abort a DMA transfer.
13753  length - Match pattern length can be 1-byte or 2-byte.
13754  ignore - Enable/Disable a byte between a 2-byte pattern match.
13755  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13756  from the match abort pattern(16-bit)
13757  Returns:
13758  None.
13759  Example:
13760  <code>
13761  // Example 1
13762  // The following code is for a device with an 8-bit pattern value and no
13763  // support for pattern match ignore feature
13764  // 'handle' is a valid handle returned
13765  // by the SYS_DMA_ChannelAllocate function.
13766  uint16_t pattern;
13767  DMA_PATTERN_LENGTH length;
13768  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13769  uint8_t ignorePattern;
13770  pattern = 0x00; //Stop transfer on detection of a NULL character
13771  length = DMA_PATTERN_LENGTH_NONE;
13772  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13773  ignorePattern = 0;
13774  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13775  ignoreEnable, ignorePattern);
13776  // Example 2
13777  // The following code is for a device with a 16-bit pattern value and
13778  // support for pattern match ignore feature
13779  // 'handle' is a valid handle returned
13780  // by the SYS_DMA_ChannelAllocate function.
13781  uint16_t pattern;
13782  DMA_PATTERN_LENGTH length;
13783  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13784  uint8_t ignorePattern;
13785  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13786  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13787  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13788  ignorePattern = 0x00; \\ Any null character between the termination pattern
13789  \\ '\r' and '\n' is ignored.
13790  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13791  ignore, ignorePattern);
13792  </code>
13793  Remarks:
13794  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13795  Not all features are available on all devices.
13796  Refer to the specific device data sheet for details.
13797 */
13798 
13799 void
13801  SYS_DMA_CHANNEL_HANDLE handle ,
13802  uint16_t pattern ,
13803  DMA_PATTERN_LENGTH length ,
13805  uint8_t ignorePattern ) ;
13806 //******************************************************************************
13807 /* Function:
13808  void SYS_DMA_ChannelCRCSet
13809  (
13810  SYS_DMA_CHANNEL_HANDLE handle,
13811  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13812  )
13813  Summary:
13814  Sets up the CRC operation mode.
13815  Description:
13816  This function sets up the CRC computation features.
13817  Precondition:
13818  DMA should have been initialized by calling SYS_DMA_Initialize.
13819  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13820  The function SYS_DMA_ChannelSetup must be called to enable
13821  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13822  Parameters:
13823  handle - Handle of the DMA channel as returned by the
13824  SYS_DMA_ChannelAllocate function.
13825  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13826  crc.mode - Compute the CRC in Background/Append mode.
13827  crc.polyLength - Denotes the length of the polynomial.
13828  crc.bitOrder - CRC is calculated LSb/MSb first.
13829  crc.byteOrder - Byte selection order input pre-CRC Generator
13830  crc.writeOrder - Write byte order selection post-CRC computation
13831  crc.data - Computed/Seed CRC
13832  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13833  when mode is LFSR
13834  Returns:
13835  None.
13836  Example:
13837  <code>
13838  //Example 1
13839  // DMA calculation using the CRC background mode
13840  // 'handle' is a valid handle returned
13841  // by the SYS_DMA_ChannelAllocate function.
13842  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13843  crc.type = DMA_CRC_LFSR;
13844  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13845  crc.polyLength = 16;
13846  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13847  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13848  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13849  crc.data = 0xFFFF;
13850  crc.xorBitMask = 0x1021;
13851  SYS_DMA_ChannelCRCSet(handle, crc);
13852  </code>
13853  Remarks:
13854  This feature may not be available on all devices. Refer to the specific device
13855  data sheet to determine availability.
13856 */
13857 
13858 void
13860  SYS_DMA_CHANNEL_HANDLE handle ,
13862 //******************************************************************************
13863 /* Function:
13864  uint32_t SYS_DMA_ChannelCRCGet(void)
13865  Summary:
13866  Returns the computed CRC.
13867  Description:
13868  This function returns the computed CRC
13869  Precondition:
13870  DMA should have been initialized by calling SYS_DMA_Initialize.
13871  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13872  The function SYS_DMA_ChannelSetup must be called to enable
13873  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13874  The CRC generator must have been previously setup using
13875  SYS_DMA_ChannelCRCSet.
13876  Parameters:
13877  None
13878  Returns:
13879  uint32_t - The Computed CRC.
13880  Example:
13881  <code>
13882  uint32_t computedCRC;
13883  computedCRC = SYS_DMA_ChannelCRCGet();
13884  </code>
13885  Remarks:
13886  To get the computed CRC value this function must be called after the block
13887  transfer completion event (i.e., after getting and processing the callback
13888  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13889  This feature may not be available on all devices. Refer to the specific device
13890  data sheet to determine availability.
13891 */
13892 
13893 uint32_t
13894  SYS_DMA_ChannelCRCGet ( void ) ;
13895 //******************************************************************************
13896 /* Function:
13897  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13898  Summary:
13899  Enables a channel.
13900  Description:
13901  This function enables a channel.
13902  Precondition:
13903  DMA should have been initialized by calling SYS_DMA_Initialize.
13904  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13905  The function SYS_DMA_ChannelSetup must have been called to setup and
13906  enable the required features.
13907  Parameters:
13908  handle - Handle of the DMA channel as returned by the
13909  SYS_DMA_ChannelAllocate function.
13910  Returns:
13911  None.
13912  Example:
13913  <code>
13914  // 'handle' is a valid handle returned
13915  // by the SYS_DMA_ChannelAllocate function.
13916  SYS_DMA_ChannelEnable(handle);
13917  </code>
13918  Remarks:
13919  This function may not required to be called when starting DMA setup
13920  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13921  But may be needed to be called in the registered callback to enable the
13922  channel and continue the data transfer with the existing transfer parameters
13923  previously set with 'SYS_DMA_ChannelTransferAdd'.
13924  The DMA channel is by default disabled on the completion of block
13925  transfer(callback generated)
13926 */
13927 
13928 void
13930  SYS_DMA_CHANNEL_HANDLE handle ) ;
13931 //******************************************************************************
13932 /* Function:
13933  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13934  Summary:
13935  Disables a channel.
13936  Description:
13937  This function disables a channel.
13938  Precondition:
13939  DMA should have been initialized by calling SYS_DMA_Initialize.
13940  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13941  The function SYS_DMA_ChannelSetup must have been called to setup and
13942  enable the required features.
13943  A DMA channel should have been enabled either by calling
13944  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13945  Parameters:
13946  handle - Handle of the DMA channel as returned by the
13947  SYS_DMA_ChannelAllocate function.
13948  Returns:
13949  None.
13950  Example:
13951  <code>
13952  // 'handle' is a valid handle returned
13953  // by the SYS_DMA_ChannelAllocate function.
13954  SYS_DMA_ChannelDisable(handle);
13955  </code>
13956  Remarks:
13957  None.
13958 */
13959 
13960 void
13962  SYS_DMA_CHANNEL_HANDLE handle ) ;
13963 //******************************************************************************
13964 /* Function:
13965  void SYS_DMA_ChannelTransferAdd
13966  (
13967  SYS_DMA_CHANNEL_HANDLE handle,
13968  const void *srcAddr, size_t srcSize
13969  const void *destAddr, size_t destSize,
13970  size_t cellSize
13971  )
13972  Summary:
13973  Adds a data transfer to a DMA channel and Enables the channel to start
13974  data transfer.
13975  Description:
13976  This function adds a data transfer characteristics for a DMA channel. The
13977  The source and the destination addresses, source and destination lengths,
13978  The number of bytes transferred per cell event are set. It also enables
13979  the channel to start data transfer.
13980  If the requesting client registered an event callback with the service,
13981  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13982  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13983  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13984  processed successfully.
13985  Precondition:
13986  DMA should have been initialized by calling SYS_DMA_Initialize.
13987  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13988  The function SYS_DMA_ChannelSetup must have been called to setup and
13989  enable the required features.
13990  Parameters:
13991  handle - Handle of the DMA channel as returned by the
13992  SYS_DMA_ChannelAllocate function.
13993  srcAddr - Source of the DMA transfer
13994  srcSize - Size of the source
13995  destAddr - Destination of the DMA transfer
13996  destSize - Size of the destination
13997  cellSize - Size of the cell
13998  Returns:
13999  None.
14000  Example:
14001  <code>
14002  // Add 10 bytes of data transfer to UART TX
14003  // 'handle' is a valid handle returned
14004  // by the SYS_DMA_ChannelAllocate function.
14005  MY_APP_OBJ myAppObj;
14006  uint8_t buf[10];
14007  void *srcAddr;
14008  void *destAddr;
14009  size_t srcSize;
14010  size_t destSize;
14011  size_t cellSize;
14012  srcAddr = (uint8_t *) buf;
14013  srcSize = 10;
14014  destAddr = (uin8_t*) &U2TXREG;
14015  destSize = 1;
14016  cellSize = 1;
14017  // User registers an event handler with system service. This is done once
14018  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14019  (uintptr_t)&myAppObj);
14020  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14021  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14022  {
14023  // Error handling here
14024  }
14025  // Event Processing Technique. Event is received when
14026  // the transfer is processed.
14027  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14028  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14029  {
14030  switch(event)
14031  {
14032  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14033  // This means the data was transferred.
14034  break;
14035  case SYS_DMA_TRANSFER_EVENT_ERROR:
14036  // Error handling here.
14037  break;
14038  default:
14039  break;
14040  }
14041  }
14042  </code>
14043  Remarks:
14044  For PIC32MZ series of devices, if the source/destination addresses are
14045  RAM memory addresses, the the source/destination buffers
14046  should be made coherent to avoid the cache coherency issues.
14047  For example:
14048  <code>
14049  uint8_t buffer[1024];
14050  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14051  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14052  </code>
14053 */
14054 
14055 void
14057  SYS_DMA_CHANNEL_HANDLE handle ,
14058  const void * srcAddr ,
14059  size_t srcSize ,
14060  const void * destAddr ,
14061  size_t destSize ,
14062  size_t cellSize ) ;
14063 //******************************************************************************
14064 /* Function:
14065  void SYS_DMA_ChannelTransferSet
14066  (
14067  SYS_DMA_CHANNEL_HANDLE handle,
14068  const void *srcAddr, size_t srcSize
14069  const void *destAddr, size_t destSize,
14070  size_t cellSize
14071  )
14072  Summary:
14073  Sets up a data transfer to a DMA channel.
14074  Description:
14075  This function sets up data transfer characteristics for a DMA channel. The
14076  The source and the destination addresses, source and destination lengths,
14077  The number of bytes transferred per cell event are set.
14078  This function does not enables the DMA channel. The channel has to be explicitly
14079  enabled to start the data transfer.
14080  The above functions could be used in situations where in the user intends to
14081  setup transfer parameters but do not intend to enable the channel immediately.
14082  For example to chain to DMA channels in a cyclic order where the channels remains
14083  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14084  condition occurs.
14085  Precondition:
14086  DMA should have been initialized by calling SYS_DMA_Initialize.
14087  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14088  The function SYS_DMA_ChannelSetup must have been called to setup and
14089  enable the required features.
14090  Parameters:
14091  handle - Handle of the DMA channel as returned by the
14092  SYS_DMA_ChannelAllocate function.
14093  srcAddr - Source of the DMA transfer
14094  srcSize - Size of the source
14095  destAddr - Destination of the DMA transfer
14096  destSize - Size of the destination
14097  cellSize - Size of the cell
14098  Returns:
14099  None.
14100  Example:
14101  <code>
14102  // Set up 10 bytes of data transfer to UART TX
14103  // 'handle' is a valid handle returned
14104  // by the SYS_DMA_ChannelAllocate function.
14105  MY_APP_OBJ myAppObj;
14106  uint8_t buf[10];
14107  void *srcAddr;
14108  void *destAddr;
14109  size_t srcSize;
14110  size_t destSize;
14111  size_t cellSize;
14112  srcAddr = (uint8_t *) buf;
14113  srcSize = 10;
14114  destAddr = (uin8_t*) &U2TXREG;
14115  destSize = 1;
14116  cellSize = 1;
14117  // User registers an event handler with system service. This is done once
14118  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14119  (uintptr_t)&myAppObj);
14120  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14121  SYS_DMA_ChannelEnable(handle);
14122  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14123  {
14124  // Error handling here
14125  }
14126  // Event Processing Technique. Event is received when
14127  // the transfer is processed.
14128  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14129  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14130  {
14131  switch(event)
14132  {
14133  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14134  // This means the data was transferred.
14135  break;
14136  case SYS_DMA_TRANSFER_EVENT_ERROR:
14137  // Error handling here.
14138  break;
14139  default:
14140  break;
14141  }
14142  }
14143  </code>
14144  Remarks:
14145  For PIC32MZ series of devices, if the source/destination addresses are
14146  RAM memory addresses, the the source/destination buffers
14147  should be made coherent to avoid the cache coherency issues.
14148  For example:
14149  <code>
14150  uint8_t buffer[1024];
14151  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14152  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14153  </code>
14154 */
14155 
14156 void
14158  SYS_DMA_CHANNEL_HANDLE handle ,
14159  const void * srcAddr ,
14160  size_t srcSize ,
14161  const void * destAddr ,
14162  size_t destSize ,
14163  size_t cellSize ) ;
14164 //******************************************************************************
14165 /* Function:
14166  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14167  Summary:
14168  Returns the number of bytes transferred from source.
14169  Description:
14170  When a data transfer request is submitted. At any time while the transmission
14171  is in progress the size of the amount of data transferred from source
14172  can be known by calling this function.
14173  Precondition:
14174  DMA should have been initialized by calling SYS_DMA_Initialize.
14175  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14176  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14177  SYS_DMA_ChannelTransferSet.
14178  Parameters:
14179  handle - A valid channel handle, returned from the system service's
14180  Allocate routine
14181  Returns:
14182  size_t - Returns the number of bytes transferred from the submitted size.
14183  Example:
14184  <code>
14185  // 'handle' is a valid handle returned
14186  // by the SYS_DMA_ChannelAllocate function.
14187  MY_APP_OBJ myAppObj;
14188  uint8_t buf[10];
14189  void *srcAddr;
14190  void *destAddr;
14191  size_t srcSize;
14192  size_t destSize;
14193  size_t cellSize;
14194  size_t transferredSize;
14195  srcAddr = (uint8_t *) buf;
14196  srcSize = 10;
14197  destAddr = (uin8_t*) &U2TXREG;
14198  destSize = 1;
14199  cellSize = 1;
14200  channelHandle = SYS_DMA_ChannelAllocate(channel);
14201  // User registers an event handler with system service. This is done once
14202  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14203  (uintptr_t)&myAppObj);
14204  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14205  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14206  {
14207  // Error handling here
14208  }
14209  // The data is being transferred after adding the transfer to the DMA channel.
14210  // The user can get to know dynamically the amount of data
14211  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14212  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14213  </code>
14214  Remarks:
14215  None.
14216 */
14217 
14218 size_t
14220  SYS_DMA_CHANNEL_HANDLE handle ) ;
14221 //******************************************************************************
14222 /* Function:
14223  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14224  Summary:
14225  Returns the number of bytes transferred to destination.
14226  Description:
14227  When a data transfer request is submitted. At any time while the transmission
14228  is in progress the size of the amount of data transferred to destination
14229  can be known by calling this function.
14230  Precondition:
14231  DMA should have been initialized by calling SYS_DMA_Initialize.
14232  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14233  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14234  SYS_DMA_ChannelTransferSet.
14235  Parameters:
14236  handle - A valid channel handle, returned from the system service's
14237  Allocate routine
14238  Returns:
14239  size_t - Returns the number of bytes received from the submitted size.
14240  Example:
14241  <code>
14242  // 'handle' is a valid handle returned
14243  // by the SYS_DMA_ChannelAllocate function.
14244  MY_APP_OBJ myAppObj;
14245  uint8_t buf[10];
14246  void *srcAddr;
14247  void *destAddr;
14248  size_t srcSize;
14249  size_t destSize;
14250  size_t cellSize;
14251  size_t transferredSize;
14252  srcAddr = (uin8_t*) &U2RXREG;
14253  srcSize = 1;
14254  destAddr = (uint8_t *) buf ;
14255  destSize = 10;
14256  cellSize = 1;
14257  channelHandle = SYS_DMA_ChannelAllocate(channel);
14258  // User registers an event handler with system service. This is done once
14259  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14260  (uintptr_t)&myAppObj);
14261  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14262  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14263  {
14264  // Error handling here
14265  }
14266  // The data is being transferred after adding the transfer to the DMA channel.
14267  // The user can get to know dynamically the amount of data
14268  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14269  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14270  </code>
14271  Remarks:
14272  None.
14273 */
14274 
14275 size_t
14277  SYS_DMA_CHANNEL_HANDLE handle ) ;
14278 //******************************************************************************
14279 /*
14280  Function:
14281  void SYS_DMA_ChannelTransferEventHandlerSet
14282  (
14283  SYS_DMA_CHANNEL_HANDLE handle,
14284  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14285  const uintptr_t contextHandle
14286  )
14287  Summary:
14288  This function allows a DMA system service client to set an event handler.
14289  Description:
14290  This function allows a client to set an event handler. The client may want
14291  to receive transfer related events in cases when it uses non-blocking read and
14292  write functions. The event handler should be set before the client
14293  intends to perform operations that could generate events.
14294  This function accepts a contextHandle parameter. This parameter could be
14295  set by the client to contain (or point to) any client specific data object
14296  that should be associated with this DMA channel.
14297  Precondition:
14298  DMA should have been initialized by calling SYS_DMA_Initialize.
14299  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14300  Parameters:
14301  handle - A valid channel handle, returned from the system service's
14302  Allocate routine
14303  eventHandler - Pointer to the event handler function.
14304  contextHandle - Value identifying the context of the application/driver/middleware
14305  that registered the event handling function.
14306  Returns:
14307  None.
14308  Example:
14309  <code>
14310  // 'handle' is a valid handle returned
14311  // by the SYS_DMA_ChannelAllocate function.
14312  MY_APP_OBJ myAppObj;
14313  uint8_t buf[10];
14314  void *srcAddr;
14315  void *destAddr;
14316  size_t srcSize;
14317  size_t destSize;
14318  size_t cellSize;
14319  srcAddr = (uint8_t *) buf;
14320  srcSize = 10;
14321  destAddr = (uin8_t*) &U2TXREG;
14322  destSize = 1;
14323  cellSize = 1;
14324  channelHandle = SYS_DMA_ChannelAllocate(channel);
14325  // User registers an event handler with system service. This is done once
14326  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14327  (uintptr_t)&myAppObj);
14328  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14329  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14330  {
14331  // Error handling here
14332  }
14333  // Event Processing Technique. Event is received when
14334  // the transfer is processed.
14335  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14336  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14337  {
14338  switch(event)
14339  {
14340  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14341  // This means the data was transferred.
14342  break;
14343  case SYS_DMA_TRANSFER_EVENT_ERROR:
14344  // Error handling here.
14345  break;
14346  default:
14347  break;
14348  }
14349  }
14350  </code>
14351  Remarks:
14352  None.
14353  */
14354 
14355 void
14357  SYS_DMA_CHANNEL_HANDLE handle ,
14358  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14359  const uintptr_t contextHandle ) ;
14360 // *****************************************************************************
14361 /* Function:
14362  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14363  Summary:
14364  This function returns the error(if any) associated with the last client
14365  request.
14366  Description:
14367  This function returns the error(if any) associated with the last client
14368  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14369  the client can call this function to know the error cause.
14370  The error status will be updated on every operation and should be read
14371  frequently (ideally immediately after the service operation has completed)
14372  to know the relevant error status.
14373  Precondition:
14374  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14375  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14376  handle.
14377  Parameters:
14378  handle - Handle of the DMA channel as returned by the
14379  SYS_DMA_ChannelAllocate function.
14380  Returns:
14381  A SYS_DMA_ERROR type indicating last known error status.
14382  Example:
14383  <code>
14384  // 'handle' is a valid handle returned
14385  // by the SYS_DMA_ChannelAllocate function.
14386  // pDmaSrc, pDmaDst is the source,destination address
14387  // txferSrcSize, txferDesSize is the source,destination transfer size
14388  // cellSize is the cell size
14389  MY_APP_OBJ myAppObj;
14390  // Client registers an event handler with service. This is done once
14391  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14392  (uintptr_t)&myAppObj );
14393  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14394  DMA_TRIGGER_SOURCE_NONE);
14395  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14396  pDmaDst,txferDesSize,cellSize);
14397  SYS_DMA_ChannelForceStart(handle);
14398  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14399  {
14400  // Error handling here
14401  }
14402  // Event Processing Technique. Event is received when
14403  // the transfer is processed.
14404  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14405  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14406  {
14407  switch(event)
14408  {
14409  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14410  // This means the data was transferred.
14411  break;
14412  case SYS_DMA_TRANSFER_EVENT_ERROR:
14413  // Error handling here.
14414  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14415  {
14416  // There was an address error.
14417  // Do error handling here.
14418  }
14419  break;
14420  default:
14421  break;
14422  }
14423  }
14424  </code>
14425  Remarks:
14426  It is the client's responsibility to make sure that the error status is
14427  obtained frequently. The service will update the error status
14428  regardless of whether this has been examined by the client.
14429 */
14430 
14433  SYS_DMA_CHANNEL_HANDLE handle ) ;
14434 //******************************************************************************
14435 /* Function:
14436  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14437  Summary:
14438  Force start of transfer on the selected channel.
14439  Description:
14440  The function force start a DMA transfer to occur for the selected channel.
14441  Precondition:
14442  DMA should have been initialized by calling SYS_DMA_Initialize.
14443  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14444  The function SYS_DMA_ChannelSetup must have been called to setup and
14445  enable the required features.
14446  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14447  Parameters:
14448  handle - Handle of the DMA channel as returned by the
14449  SYS_DMA_ChannelAllocate function.
14450  Returns:
14451  None.
14452  Example:
14453  <code>
14454  // 'handle' is a valid handle returned
14455  // by the SYS_DMA_ChannelAllocate function.
14456  // pDmaSrc, pDmaDst is the source,destination address
14457  // txferSrcSize, txferDesSize is the source,destination transfer size
14458  // cellSize is the cell size
14459  MY_APP_OBJ myAppObj;
14460  // Client registers an event handler with service. This is done once
14461  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14462  (uintptr_t)&myAppObj );
14463  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14464  DMA_TRIGGER_SOURCE_NONE);
14465  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14466  pDmaDst,txferDesSize,cellSize);
14467  SYS_DMA_ChannelForceStart(handle);
14468  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14469  {
14470  // Error handling here
14471  }
14472  // Event Processing Technique. Event is received when
14473  // the transfer is processed.
14474  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14475  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14476  {
14477  switch(event)
14478  {
14479  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14480  // This means the data was transferred.
14481  break;
14482  case SYS_DMA_TRANSFER_EVENT_ERROR:
14483  // Error handling here.
14484  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14485  {
14486  // There was an address error.
14487  // Do error handling here.
14488  }
14489  break;
14490  default:
14491  break;
14492  }
14493  }
14494  </code>
14495  Remarks:
14496  This function must be used to start the DMA transfer when the channel has been
14497  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14498 */
14499 
14500 void
14502  SYS_DMA_CHANNEL_HANDLE handle ) ;
14503 //******************************************************************************
14504 /* Function:
14505  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14506  Summary:
14507  Force abort of transfer on the selected channel.
14508  Description:
14509  The function aborts a DMA transfer to occur for the selected channel.
14510  Precondition:
14511  DMA should have been initialized by calling SYS_DMA_Initialize.
14512  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14513  The function SYS_DMA_ChannelSetup must have been called to setup and
14514  enable the required features.
14515  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14516  Parameters:
14517  handle - Handle of the DMA channel as returned by the
14518  SYS_DMA_ChannelAllocate function.
14519  Returns:
14520  None.
14521  Example:
14522  <code>
14523  // 'handle' is a valid handle returned
14524  // by the SYS_DMA_ChannelAllocate function.
14525  // pDmaSrc, pDmaDst is the source,destination address
14526  // txferSrcSize, txferDesSize is the source,destination transfer size
14527  // cellSize is the cell size
14528  MY_APP_OBJ myAppObj;
14529  // Client registers an event handler with service. This is done once
14530  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14531  (uintptr_t)&myAppObj );
14532  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14533  DMA_TRIGGER_SOURCE_NONE);
14534  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14535  pDmaDst,txferDesSize,cellSize);
14536  SYS_DMA_ChannelForceStart(handle);
14537  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14538  {
14539  // Error handling here
14540  }
14541  ....
14542  ....
14543  // Client may need to abort a transfer
14544  SYS_DMA_ChannelForceAbort(handle);
14545  // Event Processing Technique. Event is received when
14546  // the transfer is processed.
14547  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14548  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14549  {
14550  switch(event)
14551  {
14552  case SYS_DMA_TRANSFER_EVENT_ABORT:
14553  // This means the data was transferred.
14554  break;
14555  case SYS_DMA_TRANSFER_EVENT_ERROR:
14556  // Error handling here.
14557  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14558  {
14559  // There was an address error.
14560  // Do error handling here.
14561  }
14562  break;
14563  default:
14564  break;
14565  }
14566  }
14567  </code>
14568  Remarks:
14569  This function must be used to abort the DMA transfer when the channel has been
14570  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14571  and SYS_DMA_ChannelAbortEventSet has not been called.
14572 */
14573 
14574 void
14576  SYS_DMA_CHANNEL_HANDLE handle ) ;
14577 //******************************************************************************
14578 /* Function:
14579  void SYS_DMA_ChannelAbortEventSet
14580  (
14581  SYS_DMA_CHANNEL_HANDLE handle,
14582  DMA_TRIGGER_SOURCE eventSrc
14583  )
14584  Summary:
14585  Sets an event source and enables cell transfer abort event for the same
14586  for the selected channel.
14587  Description:
14588  This functions enables a cell transfer abort event for the selected source
14589  event.
14590  Precondition:
14591  DMA should have been initialized by calling SYS_DMA_Initialize.
14592  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14593  The function SYS_DMA_ChannelSetup must have been called to setup and
14594  enable the required features.
14595  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14596  Parameters:
14597  handle - Handle of the DMA channel as returned by the
14598  SYS_DMA_ChannelAllocate function.
14599  eventSrc - The event causing the cell transfer abort
14600  Returns:
14601  None.
14602  Example:
14603  <code>
14604  // 'handle' is a valid handle returned
14605  // by the SYS_DMA_ChannelAllocate function.
14606  // pDmaSrc, pDmaDst is the source,destination address
14607  // txferSrcSize, txferDesSize is the source,destination transfer size
14608  // cellSize is the cell size
14609  MY_APP_OBJ myAppObj;
14610  // Client registers an event handler with service. This is done once
14611  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14612  (uintptr_t)&myAppObj );
14613  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14614  DMA_TRIGGER_SOURCE_NONE);
14615  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14616  pDmaDst,txferDesSize,cellSize);
14617  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14618  SYS_DMA_ChannelForceStart(handle);
14619  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14620  {
14621  // Error handling here
14622  }
14623  // Event Processing Technique. Event is received when
14624  // the transfer is processed.
14625  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14626  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14627  {
14628  switch(event)
14629  {
14630  case SYS_DMA_TRANSFER_EVENT_ABORT:
14631  // This means the data was transferred.
14632  break;
14633  case SYS_DMA_TRANSFER_EVENT_ERROR:
14634  // Error handling here.
14635  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14636  {
14637  // There was an address error.
14638  // Do error handling here.
14639  }
14640  break;
14641  default:
14642  break;
14643  }
14644  }
14645  </code>
14646  Remarks:
14647  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14648  current DMA transfer will be aborted. The behavior is a same as calling
14649  SYS_DMA_ChannelForceAbort.
14650 */
14651 
14652 void
14654  SYS_DMA_CHANNEL_HANDLE handle ,
14655  DMA_TRIGGER_SOURCE eventSrc ) ;
14656 //******************************************************************************
14657 /* Function:
14658  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14659  Summary:
14660  Returns the busy status of the specified DMA channel.
14661  Description:
14662  This function returns the busy status of the selected DMA channel
14663  Precondition:
14664  DMA should have been initialized by calling SYS_DMA_Initialize.
14665  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14666  Parameters:
14667  handle - Handle of the DMA channel as returned by the
14668  SYS_DMA_ChannelAllocate function.
14669  Returns:
14670  bool - true, if the selected DMA channel is active or enabled
14671  - false, if the selected DMA channel is inactive or disabled
14672  Example:
14673  <code>
14674  bool busyStat;
14675  busyStat = SYS_DMA_ChannelGetBusy(handle);
14676  </code>
14677  Remarks:
14678  This feature may not be available on all devices. Refer to the specific device
14679  data sheet to determine availability.
14680 */
14681 
14682 bool
14684  SYS_DMA_CHANNEL_HANDLE handle ) ;
14685 //******************************************************************************
14686 /* Function:
14687  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14688  Summary:
14689  Suspend DMA operation on the specified DMA channel.
14690  Description:
14691  This function suspends the DMA operation on the DMA channel
14692  specified by the channel handle.
14693  Precondition:
14694  DMA should have been initialized by calling SYS_DMA_Initialize.
14695  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14696  Parameters:
14697  handle - Handle of the DMA channel as returned by the
14698  SYS_DMA_ChannelAllocate function.
14699  Returns:
14700  None.
14701  Example:
14702  <code>
14703  SYS_DMA_ChannelSuspend(handle);
14704  </code>
14705  Remarks:
14706  This feature may not be available on all devices. Refer to the specific device
14707  data sheet to determine availability.
14708 */
14709 
14710 void
14712  SYS_DMA_CHANNEL_HANDLE handle ) ;
14713 //******************************************************************************
14714 /* Function:
14715  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14716  Summary:
14717  Resume DMA operation on the specified DMA channel.
14718  Description:
14719  This function resumes the DMA operation on the DMA channel
14720  specified by the channel handle.
14721  Precondition:
14722  DMA should have been initialized by calling SYS_DMA_Initialize.
14723  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14724  Parameters:
14725  handle - Handle of the DMA channel as returned by the
14726  SYS_DMA_ChannelAllocate function.
14727  Returns:
14728  None.
14729  Example:
14730  <code>
14731  SYS_DMA_ChannelResume(handle);
14732  </code>
14733  Remarks:
14734  This feature may not be available on all devices. Refer to the specific device
14735  data sheet to determine availability.
14736 */
14737 
14738 void
14740  SYS_DMA_CHANNEL_HANDLE handle ) ;
14741 // *****************************************************************************
14742 // *****************************************************************************
14743 // Section: Global DMA Management Functions
14744 // *****************************************************************************
14745 // *****************************************************************************
14746 //******************************************************************************
14747 /* Function:
14748  void SYS_DMA_Suspend(void)
14749  Summary:
14750  Suspend DMA transfers.
14751  Description:
14752  This function suspends DMA transfers to allow CPU uninterrupted access
14753  to data bus
14754  Precondition:
14755  DMA should have been initialized by calling SYS_DMA_Initialize.
14756  Parameters:
14757  None.
14758  Returns:
14759  None.
14760  Example:
14761  <code>
14762  SYS_DMA_Suspend();
14763  </code>
14764  Remarks:
14765  None
14766 */
14767 
14768 void
14769  SYS_DMA_Suspend ( void ) ;
14770 //******************************************************************************
14771 /* Function:
14772  void SYS_DMA_Resume(void)
14773  Summary:
14774  Resume DMA operations.
14775  Description:
14776  This function disables DMA suspend. It resumes the DMA operation suspended
14777  by calling SYS_DMA_Suspend. The DMA operates normally.
14778  Precondition:
14779  DMA should have been initialized by calling SYS_DMA_Initialize.
14780  Parameters:
14781  None.
14782  Returns:
14783  None.
14784  Example:
14785  <code>
14786  SYS_DMA_Resume();
14787  </code>
14788  Remarks:
14789  None
14790 */
14791 
14792 void
14793  SYS_DMA_Resume ( void ) ;
14794 //******************************************************************************
14795 /* Function:
14796  bool SYS_DMA_IsBusy(void)
14797  Summary:
14798  Returns the busy status of the DMA module.
14799  Description:
14800  This function returns the busy status of the DMA module
14801  Precondition:
14802  DMA should have been initialized by calling SYS_DMA_Initialize.
14803  Parameters:
14804  None.
14805  Returns:
14806  Boolean
14807  - true - The DMA module is active
14808  - false - The DMA module is inactive and disabled
14809  <code>
14810  bool busyStat;
14811  busyStat = SYS_DMA_IsBusy();
14812  </code>
14813  Remarks:
14814  This feature may not be available on all devices. Refer to the specific device
14815  data sheet to determine availability.
14816 */
14817 
14818 bool
14819  SYS_DMA_IsBusy ( void ) ;
14820 // *****************************************************************************
14821 // *****************************************************************************
14822 // Section: Deprecated functions
14823 // *****************************************************************************
14824 // *****************************************************************************
14825 //*******************************************************************************
14826 /* Function:
14827  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14828  Summary:
14829  This function is deprecated. Use SYS_DMA_Tasks function.
14830  */
14831 
14832 void
14833  SYS_DMA_Tasks (
14834  SYS_MODULE_OBJ object ,
14835  DMA_CHANNEL activeChannel ) ;
14836 //*****************************************************************************
14837 /* Function:
14838  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14839  Summary:
14840  This function is deprecated. Use SYS_DMA_Tasks function.
14841  */
14842 
14843 void
14845  SYS_MODULE_OBJ object ) ;
14846 //*******************************************************************************
14847 /* Function:
14848  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14849  Summary:
14850  This function is deprecated. Use SYS_DMA_Tasks function.
14851  */
14852 
14853 void
14855  SYS_MODULE_OBJ object ,
14856  DMA_CHANNEL activeChannel ) ;
14857  // #ifndef _SYS_DMA_H
14858 /*******************************************************************************
14859  End of File
14860 */
14861 
14862 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14863 /* CLOSE_FILE Include File */
14864 
14865 // DOM-IGNORE-BEGIN
14866 // DOM-IGNORE-END
14867 // *****************************************************************************
14868 // *****************************************************************************
14869 // Section: Data Types
14870 // *****************************************************************************
14871 // *****************************************************************************
14872 // *****************************************************************************
14873 /* Driver USART Module Index
14874  Summary:
14875  USART driver index definitions
14876  Description:
14877  These constants provide USART driver index definitions.
14878  Remarks:
14879  These constants should be used in place of hard-coded numeric literals.
14880  These values should be passed into the DRV_USART_Initialize and
14881  DRV_USART_Open routines to identify the driver instance in use.
14882 */
14883 #define DRV_USART_INDEX_0 0
14884 #define DRV_USART_INDEX_1 1
14885 #define DRV_USART_INDEX_2 2
14886 #define DRV_USART_INDEX_3 3
14887 #define DRV_USART_INDEX_4 4
14888 #define DRV_USART_INDEX_5 5
14889 // *****************************************************************************
14890 /* USART Driver Module Count
14891  Summary:
14892  Number of valid USART drivers
14893  Description:
14894  This constant identifies the maximum number of USART Driver instances that
14895  should be defined in the system. Defining more instances than this
14896  constant will waste RAM memory space.
14897  This constant can also be used by the system and application to identify the
14898  number of USART instances on this microcontroller.
14899  Remarks:
14900  This value is part-specific.
14901 */
14902 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14903 // *****************************************************************************
14904 /* USART Driver Write Error
14905  Summary:
14906  USART Driver Write Error.
14907  Description:
14908  This constant is returned by DRV_USART_Write() function when an error
14909  occurs.
14910  Remarks:
14911  None.
14912 */
14913 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14914 // *****************************************************************************
14915 /* USART Driver Read Error
14916  Summary:
14917  USART Driver Read Error.
14918  Description:
14919  This constant is returned by DRV_USART_Read() function when an error
14920  occurs.
14921  Remarks:
14922  None.
14923 */
14924 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14925 // *****************************************************************************
14926 /* USART Driver Buffer Handle
14927  Summary:
14928  Handle identifying a read or write buffer passed to the driver.
14929  Description:
14930  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14931  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14932  buffer passed into the function and it allows the application to track the
14933  completion of the data from (or into) that buffer. The buffer handle value
14934  returned from the "buffer add" function is returned back to the client
14935  by the "event handler callback" function registered with the driver.
14936  The buffer handle assigned to a client request expires when the client has
14937  been notified of the completion of the buffer transfer (after event handler
14938  function that notifies the client returns) or after the buffer has been
14939  retired by the driver if no event handler callback was set.
14940  Remarks:
14941  None
14942 */
14943 
14944 typedef
14945 uintptr_t
14947 // *****************************************************************************
14948 /* USART Driver Invalid Buffer Handle
14949  Summary:
14950  Definition of an invalid buffer handle.
14951  Description:
14952  This is the definition of an invalid buffer handle. An invalid buffer handle
14953  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14954  functions if the buffer add request was not successful.
14955  Remarks:
14956  None
14957 */
14958 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14959 // *****************************************************************************
14960 /* USART Modes of Operation
14961  Summary:
14962  Identifies the modes of the operation of the USART module
14963  Description:
14964  This data type identifies the modes of the operation of the USART module.
14965  Remarks:
14966  Not all modes are available on all devices. Refer to the specific device data
14967  sheet to determine availability.
14968 */
14969 
14970 typedef
14971  enum
14972  {
14973  /* USART works in IRDA mode */
14975  /* This is the normal point to point communication mode where the USART
14976  communicates directly with another USART by connecting it's Transmit signal
14977  to the external USART's Receiver signal and vice versa. An external
14978  transceiver may be connected to obtain RS-232 signal levels. This type of
14979  connection is typically full duplex. */
14981  /* This is a multi-point bus mode where the USART can communicate with
14982  many other USARTS on a bus using an address-based protocol such as RS-485.
14983  This mode is typically half duplex and the physical layer may require a
14984  transceiver. In this mode every USART on the bus is assigned an address and
14985  the number of data bits is 9 bits */
14987  /* Loopback mode internally connects the Transmit signal to the Receiver
14988  signal, looping data transmission back into this USART's own input. It is
14989  useful primarily as a test mode. */
14992 // *****************************************************************************
14993 /* USART Driver Buffer Events
14994  Summary
14995  Identifies the possible events that can result from a buffer add request.
14996  Description
14997  This enumeration identifies the possible events that can result from a
14998  buffer add request caused by the client calling either the
14999  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15000  Remarks:
15001  One of these values is passed in the "event" parameter of the event
15002  handling callback function that the client registered with the driver by
15003  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15004  transfer request is completed.
15005 */
15006 
15007 typedef
15008  enum
15009  {
15010  /* All data from or to the buffer was transferred successfully. */
15012  /* There was an error while processing the buffer transfer request. */
15014  /* Data transfer aborted (Applicable in DMA mode) */
15017 // *****************************************************************************
15018 /* USART Driver Buffer Result
15019  Summary
15020  Identifies the possible result of the buffer processing.
15021  Description
15022  This enumeration identifies the possible result of the buffer processing.
15023 
15024  Remarks:
15025  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15026  is in the free buffer pool.
15027 */
15028 
15029 typedef
15030  enum
15031  {
15032  /* Buffer handle is not valid*/
15034  /* Buffer handle has expired. */
15036  /* Buffer is removed from the queue succesfully*/
15038  /* Buffer removal failed because of unable to acquire the mutex
15039  * This is applicable in RTOS mode only */
15042 // *****************************************************************************
15043 /* USART Driver Buffer Event Handler Function Pointer
15044  Summary
15045  Pointer to a USART Driver Buffer Event handler function
15046  Description
15047  This data type defines the required function signature for the USART driver
15048  buffer event handling callback function. A client must register a pointer
15049  to a buffer event handling function whose function signature (parameter
15050  and return value types) match the types specified by this function pointer
15051  in order to receive buffer related event calls back from the driver.
15052  The parameters and return values and are described here and
15053  a partial example implementation is provided.
15054  Parameters:
15055  event - Identifies the type of event
15056  bufferHandle - Handle identifying the buffer to which the vent relates
15057  context - Value identifying the context of the application that registered
15058  the event handling function.
15059  Returns:
15060  None.
15061  Example:
15062  <code>
15063  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15064  DRV_USART_BUFFER_HANDLE bufferHandle,
15065  uintptr_t context )
15066  {
15067  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15068  switch(event)
15069  {
15070  case DRV_USART_BUFFER_EVENT_COMPLETE:
15071  // Handle the completed buffer.
15072  break;
15073  case DRV_USART_BUFFER_EVENT_ERROR:
15074  default:
15075  // Handle error.
15076  break;
15077  }
15078  }
15079  </code>
15080  Remarks:
15081  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15082  transferred successfully.
15083  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15084  transferred successfully. The DRV_USART_ErrorGet function can be called to
15085  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15086  called to find out how many bytes were processed.
15087  The bufferHandle parameter contains the buffer handle of the buffer that
15088  associated with the event.
15089  The context parameter contains the a handle to the client context,
15090  provided at the time the event handling function was registered using the
15091  DRV_USART_BufferEventHandlerSet function. This context handle value is
15092  passed back to the client as the "context" parameter. It can be any value
15093  necessary to identify the client context or instance (such as a pointer to
15094  the client's data) instance of the client that made the buffer add request.
15095  The event handler function executes in the driver peripheral's interrupt
15096  context when the driver is configured for interrupt mode operation. It is
15097  recommended of the application to not perform process intensive or blocking
15098  operations with in this function.
15099  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15100  be called in the event handler to add a buffer to the driver queue. These
15101  functions can only be called to add buffers to the driver whose event
15102  handler is running. For example, buffers cannot be added USART2 driver in
15103  USART1 driver event handler.
15104 */
15105 
15106 typedef
15108 DRV_USART_BUFFER_HANDLE bufferHandle ,
15109 uintptr_t context ) ;
15110 // *****************************************************************************
15111 /* USART Driver Byte Event Handler Function Pointer
15112  Summary
15113  Pointer to a USART Driver Byte Event handler function
15114  Description
15115  This data type defines the required function signature for the USART driver
15116  byte event handling callback function. A client must register a pointer to a
15117  byte event handling function whose function signature (parameter and return
15118  value types) match the types specified by this function pointer in order to
15119  receive byte related event calls back from the driver.
15120  Parameters:
15121  index - Identifier for the instance
15122  Returns:
15123  None.
15124  Example:
15125  <code>
15126  void APP_MyUsartTxEventHandler(void)
15127  {
15128  // Handle the transmit byte event
15129  }
15130  </code>
15131  Remarks:
15132  The event handler function executes in the driver peripheral's interrupt
15133  context when the driver is configured for interrupt mode operation. It is
15134  recommended that the application not perform process intensive or blocking
15135  operations with in this function.
15136 */
15137 
15138 typedef
15139 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15140 // *****************************************************************************
15141 /* USART Handshake Modes
15142  Summary:
15143  Identifies the handshaking modes supported by the USART driver.
15144  Description:
15145  This data type identifies the handshaking modes supported by the USART
15146  driver.
15147  Remarks:
15148  Not all modes are available on all devices. Refer to the specific device data
15149  sheet to determine availability.
15150 */
15151 
15152 typedef
15153  enum
15154  {
15155  /* Handshaking occurs in Flow Control Mode */
15156  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15157  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15158  ,
15159  /* Handshaking occurs in Simplex Mode */
15160  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15161  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15162  ,
15163  /* No Handshaking */
15164  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15165  2 /*DOM-IGNORE-END*/
15167 // *****************************************************************************
15168 /* USART Baud Set Result
15169  Summary:
15170  Identifies the results of the baud set function.
15171  Description:
15172  This data type identifies the results of the DRV_USART_BaudSet function.
15173  Remarks:
15174  None.
15175 */
15176 
15177 typedef
15178  enum
15179  {
15180  /* The driver was not able to change the baud */
15181  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15182  - 1 /*DOM-IGNORE-END*/
15183  ,
15184  /* The driver was able to change the baud successfully */
15187 // *****************************************************************************
15188 /* USART Line Control Set Result
15189  Summary:
15190  Identifies the results of the baud set function.
15191  Description:
15192  This data type identifies the results of the DRV_USART_LineControlSet
15193  function.
15194  Remarks:
15195  None.
15196 */
15197 
15198 typedef
15199  enum
15200  {
15201  /* The driver was not able to change the Line Control */
15202  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15203  - 1 /*DOM-IGNORE-END*/
15204  ,
15205  /* The driver was able to change the Line Control successfully */
15208 // *****************************************************************************
15209 /* USART Line Control Modes
15210  Summary:
15211  Identifies the line control modes supported by the USART driver.
15212  Description:
15213  This data type identifies the line control modes supported by the USART
15214  driver. Line control modes define the number of data bits, parity mode, and
15215  the number of stop bits in a USART transmit and receive frames.
15216  Remarks:
15217  The abbreviations used in the labels for the values of this enumeration
15218  follow the format <data><parity><stop>, where:
15219  <data> is the number of data bits
15220  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15221  added to obtain an even number of bits, or "ODD" for one bit
15222  added to obtain an odd number of bits.
15223  <stop> is the number of Stop bits
15224 */
15225 
15226 typedef
15227  enum
15228  {
15229  /* 8 data bits, no parity bit, 1 stop bit */
15230  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15231  USART_8N1 /* DOM-IGNORE-END*/
15232  ,
15233  /* 9 data bits, no parity bit, 1 stop bit */
15234  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15235  USART_9N1 /* DOM-IGNORE-END*/
15236  ,
15237  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15238  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15239  USART_8E1 /* DOM-IGNORE-END*/
15240  ,
15241  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15242  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15243  USART_8E2 /* DOM-IGNORE-END*/
15244  ,
15245  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15246  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15247  USART_8O1 /* DOM-IGNORE-END*/
15248  ,
15249  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15250  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15251  USART_8O2 /* DOM-IGNORE-END*/
15252  ,
15253  /* 8 data bits, no parity bit, 2 stop bit */
15254  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15255  USART_8N2 /* DOM-IGNORE-END*/
15256  ,
15257  /* 9 data bits, no parity bit, 2 stop bit */
15258  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15259  USART_9N2 /* DOM-IGNORE-END*/
15261 // *****************************************************************************
15262 /* USART Initialization flags
15263  Summary:
15264  Flags identifying features that can be enabled when the driver is
15265  initialized.
15266  Description:
15267  This enumeration defines flags identifying features that can be enabled
15268  when the driver is initialized.
15269  Remarks:
15270  These flags can be logically ORed together. They are passed into the
15271  DRV_USART_Initialize function through the "flags" member of the
15272  DRV_USART_INIT structure.
15273 */
15274 
15275 typedef
15276  enum
15277  {
15278  /* Use this if no flags need to be set */
15279  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15280  0 /*DOM-IGNORE-END*/
15281  ,
15282  /* Flag to enable "wake on start" operation. If supported and enabled,
15283  this feature will allow the USART to wake-up the device when a
15284  Start bit is received. This option should be selected only when the
15285  device is to placed in Sleep mode. Note that enabling this bit will
15286  also cause the first received character to be lost. Refer to the specific
15287  device data sheet for more information. */
15289  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15290  ,
15291  /* Flag to enable auto baud detection. If supported and enabled, this
15292  feature will allow the USART to automatically detect the baud rate in
15293  use. */
15294  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15295  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15296  ,
15297  /* Flag to enable stop in idle. If supported and enabled , this
15298  feature will allow the USART to stop when the CPU enters Idle
15299  mode */
15301  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15303 // *****************************************************************************
15304 /* Operation Mode Initialization Data
15305  Summary:
15306  Defines the initialization data required for different operation modes of
15307  USART.
15308  Description:
15309  This data type defines the initialization data required for different
15310  operation modes of the USART.
15311  Remarks:
15312  None
15313 */
15314 
15315 typedef
15316  union
15317  {
15318  /* Initialization for Addressed mode */
15319  struct
15320  {
15321  /* Address of the device. */
15322  uint8_t address ;
15323  } AddressedModeInit ;
15325 // *****************************************************************************
15326 /* USART Driver Errors.
15327  Summary:
15328  Defines the possible errors that can occur during driver operation.
15329  Description:
15330  This data type defines the possible errors that can occur when occur during
15331  USART driver operation. These values are returned by DRV_USART_ErrorGet
15332  function.
15333  Remarks:
15334  None
15335 */
15336 
15337 typedef
15338  enum
15339  {
15340  /* There was no error */
15342  /*DOM-IGNORE-BEGIN*/
15343  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15344  ,
15345  /* This indicates that a parity error has occurred */
15347  /*DOM-IGNORE-BEGIN*/
15348  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15349  ,
15350  /* This indicates that a framing error has occurred */
15352  /*DOM-IGNORE-BEGIN*/
15353  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15354  ,
15355  /* This indicates a receiver overflow has occurred */
15357  /*DOM-IGNORE-BEGIN*/
15358  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15359  ,
15360  /* Channel address error (Applicable in DMA mode) */
15361  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15362  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15363  } DRV_USART_ERROR ;
15364 // *****************************************************************************
15365 /* USART Client-Specific Driver Status
15366  Summary:
15367  Defines the client-specific status of the USART driver.
15368  Description:
15369  This enumeration defines the client-specific status codes of the USART
15370  driver.
15371  Remarks:
15372  Returned by the DRV_USART_ClientStatus function.
15373 */
15374 
15375 typedef
15376  enum
15377  {
15378  /* An error has occurred.*/
15380  /* The driver is closed, no operations for this client are ongoing,
15381  and/or the given handle is invalid. */
15383  /* The driver is currently busy and cannot start additional operations. */
15385  /* The module is running and ready for additional operations */
15388 // *****************************************************************************
15389 /* USART Driver Transfer Flags
15390  Summary
15391  Specifies the status of the receive or transmit
15392  Description
15393  This type specifies the status of the receive or transmit operation.
15394  Remarks:
15395  More than one of these values may be OR'd together to create a complete
15396  status value. To test a value of this type, the bit of interest must be
15397  ANDed with the value and checked to see if the result is non-zero.
15398 */
15399 
15400 typedef
15401  enum
15402  {
15403  /* Indicates that at least one byte of Data has been received */
15405  /*DOM-IGNORE-BEGIN*/
15406  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15407  ,
15408  /* Indicates that the core driver receiver buffer is empty */
15410  /*DOM-IGNORE-BEGIN*/
15411  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15412  ,
15413  /* Indicates that the core driver transmitter buffer is full */
15415  /*DOM-IGNORE-BEGIN*/
15416  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15417  ,
15418  /* Indicates that the core driver transmitter buffer is empty */
15420  /*DOM-IGNORE-BEGIN*/
15421  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15423 // *****************************************************************************
15424 /* USART Driver Initialization Data
15425  Summary:
15426  Defines the data required to initialize or reinitialize the USART driver
15427  Description:
15428  This data type defines the data required to initialize or reinitialize the
15429  USART driver. If the driver is built statically, the members of this data
15430  structure are statically over-ridden by static override definitions in the
15431  system_config.h file.
15432  Remarks:
15433  None.
15434 */
15435 
15436 typedef
15437  struct
15438  {
15439  /* System module initialization data */
15440  SYS_MODULE_INIT moduleInit ;
15441  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15442  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15443  system_config.h header file. */
15444  USART_MODULE_ID usartID ;
15445  /* Identifies the Operation mode of the USART driver. For a static build of
15446  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15447  system_config.h header file. */
15449  /* Data required by the operation mode of the driver. For a static build of
15450  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15451  system_config.h header file. */
15453  /* Flags to enable specific features. Refer to the
15454  description of DRV_USART_INIT_FLAGS for more details. For a static build
15455  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15456  system_config.h header file. */
15457  DRV_USART_INIT_FLAGS flags ;
15458  /* USART module Baud Rate Generator Clock. This typically
15459  the peripheral bus clock frequency. For a static build of the driver,
15460  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15461  header file. */
15462  uint32_t brgClock ;
15463  /* The initial USART line control settings. For a static build of the driver
15464  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15465  system_config.h header file. */
15466  DRV_USART_LINE_CONTROL lineControl ;
15467  /* Baud Rate value to be used, if not using auto baud. For a static build of
15468  the driver, this is overridden by the DRV_USART_BAUD macro in the
15469  system_config.h header file. */
15470  uint32_t baud ;
15471  /* Handshaking mode. For a static build of the driver, this is overridden by
15472  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15473  DRV_USART_HANDSHAKE handshake ;
15474  /* Lines enabled for the USART operation. For a static build of the driver,
15475  this is overridden by the DRV_USART_LINES_ENABLE macro in
15476  the system_config.h header file.
15477  For PPS parts, pin selection in ports overrides this. */
15478  USART_OPERATION_MODE linesEnable ;
15479  /* Interrupt source ID for the transmitter interrupt. For a static build of
15480  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15481  macro in the system_config.h header. */
15482  INT_SOURCE interruptTransmit ;
15483  /* Interrupt source ID for the receiver interrupt. For a static build of
15484  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15485  macro in the system_config.h header. */
15486  INT_SOURCE interruptReceive ;
15487  /* Interrupt source ID for the error Interrupt. For a static build of the
15488  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15489  in the system_config.h header. */
15490  INT_SOURCE interruptError ;
15491  /* This is the receive buffer queue size. This is the maximum
15492  number of read requests that driver will queue. For a
15493  static build of the driver, this is overridden by the
15494  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15495  unsigned int queueSizeReceive ;
15496  /* This is the transmit buffer queue size. This is the maximum
15497  number of write requests that driver will queue. For a
15498  static build of the driver, this is overridden by the
15499  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15500  unsigned int queueSizeTransmit ;
15501  /* This is the USART transmit DMA channel.
15502  For a static build of the driver, this is overridden by the
15503  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15504  DMA_CHANNEL dmaChannelTransmit ;
15505  /* This is the USART receive DMA channel.
15506  For a static build of the driver, this is overridden by the
15507  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15508  DMA_CHANNEL dmaChannelReceive ;
15509  /* This is the USART transmit DMA channel interrupt.
15510  For a static build of the driver, this is overridden by the
15511  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15512  INT_SOURCE dmaInterruptTransmit ;
15513  /* This is the USART receive DMA channel interrupt.
15514  For a static build of the driver, this is overridden by the
15515  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15516  INT_SOURCE dmaInterruptReceive ;
15517  } DRV_USART_INIT ;
15518 //DOM-IGNORE-BEGIN
15519 //DOM-IGNORE-END
15520  // #ifndef _DRV_USART_DEFINITIONS_H
15521 /*******************************************************************************
15522  End of File
15523 */
15524 
15525 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15526 /* CLOSE_FILE Include File */
15527 
15528 // DOM-IGNORE-BEGIN
15529 // DOM-IGNORE-END
15530 // *****************************************************************************
15531 // *****************************************************************************
15532 // Section: USART Driver Module Interface Routines
15533 // *****************************************************************************
15534 // *****************************************************************************
15535 // *****************************************************************************
15536 /* Function:
15537  SYS_MODULE_OBJ DRV_USART_Initialize
15538  (
15539  const SYS_MODULE_INDEX index,
15540  const SYS_MODULE_INIT * const init
15541  )
15542  Summary:
15543  Initializes the USART instance for the specified driver index.
15544  <p><b>Implementation:</b> Static/Dynamic</p>
15545  Description:
15546  This routine initializes the USART driver instance for the specified driver
15547  index, making it ready for clients to open and use it. The initialization
15548  data is specified by the init parameter. The initialization may fail if the
15549  number of driver objects allocated are insufficient or if the specified
15550  driver instance is already initialized. The driver instance index is
15551  independent of the USART module ID. For example, driver instance 0 can be
15552  assigned to USART2. If the driver is built statically, then some of the
15553  initialization parameters are overridden by configuration macros. Refer to
15554  the description of the DRV_USART_INIT data structure for more details on
15555  which members on this data structure are overridden.
15556  Precondition:
15557  None.
15558  Parameters:
15559  index - Identifier for the instance to be initialized
15560  init - Pointer to a data structure containing any data necessary to
15561  initialize the driver.
15562  Returns:
15563  If successful, returns a valid handle to a driver instance object.
15564  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15565  Example:
15566  <code>
15567  // The following code snippet shows an example USART driver initialization.
15568  // The driver is initialized for normal mode and a baud of 300. The
15569  // receive queue size is set to 2 and transmit queue size is set to 3.
15570  DRV_USART_INIT usartInit;
15571  SYS_MODULE_OBJ objectHandle;
15572  usartInit.baud = 300;
15573  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15574  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15575  usartInit.usartID = USART_ID_2;
15576  usartInit.brgClock = 80000000;
15577  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15578  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15579  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15580  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15581  usartInit.queueSizeReceive = 2;
15582  usartInit.queueSizeTransmit = 3;
15583  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15584  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15585  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15586  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15587  {
15588  // Handle error
15589  }
15590  </code>
15591  Remarks:
15592  This routine must be called before any other USART routine is called.
15593  This routine should only be called once during system initialization
15594  unless DRV_USART_Deinitialize is called to deinitialize the driver
15595  instance. This routine will NEVER block for hardware access.
15596 */
15597 
15598 SYS_MODULE_OBJ
15600  const SYS_MODULE_INDEX index ,
15601  const SYS_MODULE_INIT * const init ) ;
15602 // *****************************************************************************
15603 /* Function:
15604  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15605  Summary:
15606  Deinitializes the specified instance of the USART driver module.
15607  <p><b>Implementation:</b> Static/Dynamic</p>
15608  Description:
15609  Deinitializes the specified instance of the USART driver module, disabling
15610  its operation (and any hardware). Invalidates all the internal data.
15611  Precondition:
15612  Function DRV_USART_Initialize should have been called before calling this
15613  function.
15614  Parameters:
15615  object - Driver object handle, returned from the
15616  DRV_USART_Initialize routine
15617  Returns:
15618  None.
15619  Example:
15620  <code>
15621  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15622  SYS_STATUS status;
15623  DRV_USART_Deinitialize(object);
15624  status = DRV_USART_Status(object);
15625  if (SYS_MODULE_DEINITIALIZED != status)
15626  {
15627  // Check again later if you need to know
15628  // when the driver is deinitialized.
15629  }
15630  </code>
15631  Remarks:
15632  Once the Initialize operation has been called, the Deinitialize operation
15633  must be called before the Initialize operation can be called again. This
15634  routine will NEVER block waiting for hardware.
15635 */
15636 
15637 void
15639  SYS_MODULE_OBJ object ) ;
15640 // *****************************************************************************
15641 /* Function:
15642  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15643  Summary:
15644  Gets the current status of the USART driver module.
15645  <p><b>Implementation:</b> Static/Dynamic</p>
15646  Description:
15647  This routine provides the current status of the USART driver module.
15648  Precondition:
15649  Function DRV_USART_Initialize should have been called before calling this
15650  function.
15651  Parameters:
15652  object - Driver object handle, returned from the
15653  DRV_USART_Initialize routine
15654  Returns:
15655  SYS_STATUS_READY - Indicates that the driver is busy with a
15656  previous system level operation and cannot start
15657  another
15658  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15659  deinitialized
15660  Example:
15661  <code>
15662  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15663  SYS_STATUS usartStatus;
15664  usartStatus = DRV_USART _Status(object);
15665  if (SYS_STATUS_READY == usartStatus)
15666  {
15667  // This means the driver can be opened using the
15668  // DRV_USART_Open() function.
15669  }
15670  </code>
15671  Remarks:
15672  A driver can opened only when its status is SYS_STATUS_READY.
15673 */
15674 
15675 SYS_STATUS
15677  SYS_MODULE_OBJ object ) ;
15678 // *****************************************************************************
15679 /* Function:
15680  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15681  Summary:
15682  Maintains the driver's transmit state machine and implements its ISR.
15683  <p><b>Implementation:</b> Static/Dynamic</p>
15684  Description:
15685  This routine is used to maintain the driver's internal transmit state
15686  machine and implement its transmit ISR for interrupt-driven implementations.
15687  In polling mode, this function should be called from the SYS_Tasks
15688  function. In interrupt mode, this function should be called in the transmit
15689  interrupt service routine of the USART that is associated with this USART
15690  driver hardware instance.
15691  Precondition:
15692  The DRV_USART_Initialize routine must have been called for the specified
15693  USART driver instance.
15694  Parameters:
15695  object - Object handle for the specified driver instance (returned from
15696  DRV_USART_Initialize)
15697  Returns:
15698  None.
15699  Example:
15700  <code>
15701  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15702  while (true)
15703  {
15704  DRV_USART_TasksTransmit (object);
15705  // Do other tasks
15706  }
15707  </code>
15708  Remarks:
15709  This routine is normally not called directly by an application. It is
15710  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15711  ISR.
15712  This routine may execute in an ISR context and will never block or access any
15713  resources that may cause it to block.
15714 */
15715 
15716 void
15718  SYS_MODULE_OBJ object ) ;
15719 // *****************************************************************************
15720 /* Function:
15721  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15722  Summary:
15723  Maintains the driver's receive state machine and implements its ISR.
15724  <p><b>Implementation:</b> Static/Dynamic</p>
15725  Description:
15726  This routine is used to maintain the driver's internal receive state machine
15727  and implement its receive ISR for interrupt-driven implementations. In
15728  polling mode, this function should be called from the SYS_Tasks function.
15729  In interrupt mode, this function should be called in the receive interrupt
15730  service routine of the USART that is associated with this USART driver
15731  hardware instance.
15732  Precondition:
15733  The DRV_USART_Initialize routine must have been called for the specified
15734  USART driver instance.
15735  Parameters:
15736  object - Object handle for the specified driver instance (returned from
15737  DRV_USART_Initialize)
15738  Returns:
15739  None.
15740  Example:
15741  <code>
15742  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15743  while (true)
15744  {
15745  DRV_USART_TasksReceive (object);
15746  // Do other tasks
15747  }
15748  </code>
15749  Remarks:
15750  This routine is normally not called directly by an application. It is
15751  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15752  ISR.
15753  This routine may execute in an ISR context and will never block or access any
15754  resources that may cause it to block.
15755 */
15756 
15757 void
15759  SYS_MODULE_OBJ object ) ;
15760 // *****************************************************************************
15761 /* Function:
15762  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15763  Summary:
15764  Maintains the driver's error state machine and implements its ISR.
15765  <p><b>Implementation:</b> Static/Dynamic</p>
15766  Description:
15767  This routine is used to maintain the driver's internal error state machine
15768  and implement its error ISR for interrupt-driven implementations. In
15769  polling mode, this function should be called from the SYS_Tasks function.
15770  In interrupt mode, this function should be called in the error interrupt
15771  service routine of the USART that is associated with this USART driver
15772  hardware instance.
15773  Precondition:
15774  The DRV_USART_Initialize routine must have been called for the specified
15775  USART driver instance.
15776  Parameters:
15777  object - Object handle for the specified driver instance (returned from
15778  DRV_USART_Initialize)
15779  Returns:
15780  None.
15781  Example:
15782  <code>
15783  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15784  while (true)
15785  {
15786  DRV_USART_TasksError (object);
15787  // Do other tasks
15788  }
15789  </code>
15790  Remarks:
15791  This routine is normally not called directly by an application. It is
15792  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15793  ISR.
15794  This routine may execute in an ISR context and will never block or access any
15795  resources that may cause it to block.
15796 */
15797 
15798 void
15800  SYS_MODULE_OBJ object ) ;
15801 // *****************************************************************************
15802 // *****************************************************************************
15803 // Section: USART Driver Client Routines
15804 // *****************************************************************************
15805 // *****************************************************************************
15806 // *****************************************************************************
15807 /* Function:
15808  DRV_HANDLE DRV_USART_Open
15809  (
15810  const SYS_MODULE_INDEX index,
15811  const DRV_IO_INTENT ioIntent
15812  )
15813  Summary:
15814  Opens the specified USART driver instance and returns a handle to it.
15815  <p><b>Implementation:</b> Static/Dynamic</p>
15816  Description:
15817  This routine opens the specified USART driver instance and provides a
15818  handle that must be provided to all other client-level operations to
15819  identify the caller and the instance of the driver. The ioIntent
15820  parameter defines how the client interacts with this driver instance.
15821  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15822  additionally affect the behavior of the DRV_USART_Read and
15823  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15824  then these function will not block even if the required amount of data could
15825  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15826  will block until the required amount of data is processed. If the driver is
15827  configured for polling and bare-metal operation, it will not support
15828  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15829  non-blocking.
15830  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15831  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15832  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15833  client will be able to do both, read and write.
15834  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15835  exclusive access to this client. The driver cannot be opened by any
15836  other client.
15837  Precondition:
15838  Function DRV_USART_Initialize must have been called before calling this
15839  function.
15840  Parameters:
15841  index - Identifier for the object instance to be opened
15842  intent - Zero or more of the values from the enumeration
15843  DRV_IO_INTENT "ORed" together to indicate the intended use
15844  of the driver. See function description for details.
15845  Returns:
15846  If successful, the routine returns a valid open-instance handle (a number
15847  identifying both the caller and the module instance).
15848  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15849  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15850  insufficient.
15851  - if the client is trying to open the driver but driver has been opened
15852  exclusively by another client.
15853  - if the driver hardware instance being opened is not initialized or is
15854  invalid.
15855  - if the client is trying to open the driver exclusively, but has already
15856  been opened in a non exclusive mode by another client.
15857  - if the driver is not ready to be opened, typically when the initialize
15858  routine has not completed execution.
15859  Example:
15860  <code>
15861  DRV_HANDLE handle;
15862  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15863  if (DRV_HANDLE_INVALID == handle)
15864  {
15865  // Unable to open the driver
15866  // May be the driver is not initialized or the initialization
15867  // is not complete.
15868  }
15869  </code>
15870  Remarks:
15871  The handle returned is valid until the DRV_USART_Close routine is called.
15872  This routine will NEVER block waiting for hardware.If the requested intent
15873  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15874  function is thread safe in a RTOS application.
15875 */
15876 
15877 DRV_HANDLE
15878  DRV_USART_Open (
15879  const SYS_MODULE_INDEX index ,
15880  const DRV_IO_INTENT ioIntent ) ;
15881 // *****************************************************************************
15882 /* Function:
15883  void DRV_USART_Close( DRV_Handle handle )
15884  Summary:
15885  Closes an opened-instance of the USART driver.
15886  <p><b>Implementation:</b> Static/Dynamic</p>
15887  Description:
15888  This routine closes an opened-instance of the USART driver, invalidating the
15889  handle. Any buffers in the driver queue that were submitted by this client
15890  will be removed. After calling this routine, the handle passed in "handle"
15891  must not be used with any of the remaining driver routines (with one
15892  possible exception described in the "Remarks" section). A new handle must
15893  be obtained by calling DRV_USART_Open before the caller may use the driver
15894  again
15895  Precondition:
15896  The DRV_USART_Initialize routine must have been called for the specified
15897  USART driver instance.
15898  DRV_USART_Open must have been called to obtain a valid opened device handle.
15899  Parameters:
15900  handle - A valid open-instance handle, returned from the driver's
15901  open routine
15902  Returns:
15903  None.
15904  Example:
15905  <code>
15906  DRV_HANDLE handle; // Returned from DRV_USART_Open
15907  DRV_USART_Close(handle);
15908  // After this point, the handle cannot be used with any other function
15909  // except the DRV_USART_ClientStatus function, which can be used to query
15910  // the success status of the DRV_USART_Close function.
15911  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15912  </code>
15913  Remarks:
15914  Usually there is no need for the client to verify that the Close operation
15915  has completed. The driver will abort any ongoing operations when this
15916  routine is called. However, if it requires additional time to do so in a
15917  non-blocking environment, it will still return from the Close operation but
15918  the handle is now a zombie handle. The client can only call the
15919  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15920  Close operation. The DRV_USART_ClientStatus routine will return
15921  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15922 */
15923 
15924 void
15925  DRV_USART_Close (
15926  const DRV_HANDLE handle ) ;
15927 // *****************************************************************************
15928 /*
15929  Function:
15930  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15931  Summary:
15932  Gets the current client-specific status the USART driver.
15933  <p><b>Implementation:</b> Static/Dynamic</p>
15934  Description:
15935  This function gets the client-specific status of the USART driver associated
15936  with the given handle. This function can be used to check the status of
15937  client after the DRV_USART_Close() function has been called.
15938  Preconditions:
15939  The DRV_USART_Initialize function must have been called.
15940  DRV_USART_Open must have been called to obtain a valid opened device
15941  handle.
15942  Parameters:
15943  handle - Handle returned from the driver's open function.
15944  Returns:
15945  A DRV_USART_CLIENT_STATUS value describing the current status of the
15946  driver.
15947  Example:
15948  <code>
15949  DRV_HANDLE handle; // Returned from DRV_USART_Open
15950  DRV_USART_CLIENT_STATUS status;
15951  status = DRV_USART_ClientStatus(handle);
15952  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15953  {
15954  // The client had not closed.
15955  }
15956  </code>
15957  Remarks:
15958  This function will not block for hardware access and will immediately return
15959  the current status. This function is thread safe when called in a RTOS
15960  application.
15961 */
15962 
15965  DRV_HANDLE handle ) ;
15966 // *****************************************************************************
15967 // *****************************************************************************
15968 // Section: USART Driver Buffer Queuing Model Interface Routines
15969 // *****************************************************************************
15970 // *****************************************************************************
15971 // *****************************************************************************
15972 /* Function:
15973  void DRV_USART_BufferAddWrite
15974  (
15975  const DRV_HANDLE handle,
15976  DRV_USART_BUFFER_HANDLE * bufferHandle,
15977  void * buffer,
15978  size_t size
15979  );
15980  Summary:
15981  Schedule a non-blocking driver write operation.
15982  <p><b>Implementation:</b> Static/Dynamic</p>
15983  Description:
15984  This function schedules a non-blocking write operation. The function returns
15985  with a valid buffer handle in the bufferHandle argument if the write request
15986  was scheduled successfully. The function adds the request to the hardware
15987  instance transmit queue and returns immediately. While the request is in the
15988  queue, the application buffer is owned by the driver and should not be
15989  modified. On returning, the bufferHandle parameter may be
15990  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15991  - if a buffer could not be allocated to the request
15992  - if the input buffer pointer is NULL
15993  - if the client opened the driver for read-only
15994  - if the buffer size is 0
15995  - if the transmit queue is full or the queue depth is insufficient
15996  If the requesting client registered an event callback with the driver, the
15997  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
15998  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
15999  was not processed successfully.
16000  Precondition:
16001  The DRV_USART_Initialize routine must have been called for the specified
16002  USART device instance and the DRV_USART_Status must have returned
16003  SYS_STATUS_READY.
16004  DRV_USART_Open must have been called to obtain a valid opened device handle.
16005  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16006  the DRV_USART_Open call.
16007  Parameters:
16008  handle - Handle of the communication channel as return by the
16009  DRV_USART_Open function.
16010  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16011  buffer - Data to be transmitted.
16012  size - Buffer size in bytes.
16013  Returns:
16014  The bufferHandle parameter will contain the return buffer handle. This will be
16015  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16016  Example:
16017  <code>
16018  MY_APP_OBJ myAppObj;
16019  uint8_t mybuffer[MY_BUFFER_SIZE];
16020  DRV_USART_BUFFER_HANDLE bufferHandle;
16021  // myUSARTHandle is the handle returned
16022  // by the DRV_USART_Open function.
16023  // Client registers an event handler with driver
16024  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16025  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16026  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16027  myBuffer, MY_BUFFER_SIZE);
16028  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16029  {
16030  // Error handling here
16031  }
16032  // Event is received when
16033  // the buffer is processed.
16034  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16035  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16036  {
16037  // contextHandle points to myAppObj.
16038  switch(event)
16039  {
16040  case DRV_USART_BUFFER_EVENT_COMPLETE:
16041  // This means the data was transferred.
16042  break;
16043  case DRV_USART_BUFFER_EVENT_ERROR:
16044  // Error handling here.
16045  break;
16046  default:
16047  break;
16048  }
16049  }
16050  </code>
16051  Remarks:
16052  This function is thread safe in a RTOS application. It can be called from
16053  within the USART Driver Buffer Event Handler that is registered by this
16054  client. It should not be called in the event handler associated with another
16055  USART driver instance. It should not otherwise be called directly in an ISR.
16056 */
16057 
16058 void
16060  const DRV_HANDLE handle ,
16061  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16062  void * buffer ,
16063  const size_t size ) ;
16064 // *****************************************************************************
16065 /* Function:
16066  void DRV_USART_AddressedBufferAddWrite
16067  (
16068  const DRV_HANDLE hClient,
16069  DRV_USART_BUFFER_HANDLE * bufferHandle,
16070  uint8_t address,
16071  void * source,
16072  size_t nWords
16073  );
16074  Summary:
16075  Schedule a non-blocking addressed driver write operation.
16076  <p><b>Implementation:</b> Dynamic</p>
16077  Description:
16078  This function schedules a non-blocking addressed write operation. The function returns
16079  with a valid buffer handle in the bufferHandle argument if the addressed write request
16080  was scheduled successfully. The function adds the request to the hardware
16081  instance transmit queue and returns immediately. While the request is in the
16082  queue, the application buffer is owned by the driver and should not be
16083  modified. On returning, the bufferHandle parameter may be
16084  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16085  - if a buffer could not be allocated to the request
16086  - if the input buffer pointer is NULL
16087  - if the client opened the driver for read-only
16088  - if the buffer size is 0
16089  - if the transmit queue is full or the queue depth is insufficient
16090  If the requesting client registered an event callback with the driver, the
16091  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16092  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16093  was not processed successfully.
16094  Precondition:
16095  The DRV_USART_Initialize routine must have been called for the specified
16096  USART device instance and the DRV_USART_Status must have returned
16097  SYS_STATUS_READY.
16098  DRV_USART_Open must have been called to obtain a valid opened device handle.
16099  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16100  the DRV_USART_Open call.
16101  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16102  Parameters:
16103  hClient - Handle of the communication channel as return by the
16104  DRV_USART_Open function.
16105  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16106  address - Address of the receiver client
16107  source - Data to be transmitted.
16108  size - Buffer size in 16-bit words.
16109  Returns:
16110  The bufferHandle parameter will contain the return buffer handle. This will be
16111  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16112  Example:
16113  <code>
16114  MY_APP_OBJ myAppObj;
16115  uint16_t mybuffer[MY_BUFFER_SIZE];
16116  DRV_USART_BUFFER_HANDLE bufferHandle;
16117  uint8_t clientAddress;
16118  // myUSARTHandle is the handle returned
16119  // by the DRV_USART_Open function.
16120  // Client registers an event handler with driver
16121  clientAddress = 0x60;
16122  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16123  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16124  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16125  myBuffer, MY_BUFFER_SIZE);
16126  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16127  {
16128  // Error handling here
16129  }
16130  // Event is received when
16131  // the buffer is processed.
16132  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16133  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16134  {
16135  // contextHandle points to myAppObj.
16136  switch(event)
16137  {
16138  case DRV_USART_BUFFER_EVENT_COMPLETE:
16139  // This means the data was transferred.
16140  break;
16141  case DRV_USART_BUFFER_EVENT_ERROR:
16142  // Error handling here.
16143  break;
16144  default:
16145  break;
16146  }
16147  }
16148  </code>
16149  Remarks:
16150  This function is thread safe in a RTOS application. It can be called from
16151  within the USART Driver Buffer Event Handler that is registered by this
16152  client. It should not be called in the event handler associated with another
16153  USART driver instance. It should not otherwise be called directly in an ISR.
16154  The source buffer should be a 16-bit word aligned buffer.
16155  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16156 */
16157 
16158 void
16160  const DRV_HANDLE hClient ,
16161  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16162  uint8_t address ,
16163  void * source ,
16164  size_t nWords ) ;
16165 // *****************************************************************************
16166 /* Function:
16167  void DRV_USART_BufferAddRead
16168  (
16169  const DRV_HANDLE handle,
16170  DRV_USART_BUFFER_HANDLE * bufferHandle,
16171  void * buffer,
16172  const size_t size
16173  )
16174  Summary:
16175  Schedule a non-blocking driver read operation.
16176  <p><b>Implementation:</b> Static/Dynamic</p>
16177  Description:
16178  This function schedules a non-blocking read operation. The function returns
16179  with a valid buffer handle in the bufferHandle argument if the read request
16180  was scheduled successfully. The function adds the request to the hardware
16181  instance receive queue and returns immediately. While the request is in the
16182  queue, the application buffer is owned by the driver and should not be
16183  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16184  bufferHandle argument:
16185  - if a buffer could not be allocated to the request
16186  - if the input buffer pointer is NULL
16187  - if the buffer size is 0
16188  - if the read queue size is full or queue depth is insufficient.
16189  - if the driver handle is invalid
16190  If the requesting client registered an event callback with the driver, the
16191  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16192  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16193  was not processed successfully.
16194  Precondition:
16195  The DRV_USART_Initialize routine must have been called for the specified
16196  USART device instance and the DRV_USART_Status must have returned
16197  SYS_STATUS_READY.
16198  DRV_USART_Open must have been called to obtain a valid opened device handle.
16199  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16200  the DRV_USART_Open call.
16201  Parameters:
16202  handle - Handle of the communication channel as returned by the
16203  DRV_USART_Open function.
16204  buffer - Buffer where the received data will be stored.
16205  size - Buffer size in bytes.
16206  Returns:
16207  The buffer handle is returned in the bufferHandle argument. This is
16208  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16209  Example:
16210  <code>
16211  MY_APP_OBJ myAppObj;
16212  uint8_t mybuffer[MY_BUFFER_SIZE];
16213  DRV_USART_BUFFER_HANDLE bufferHandle;
16214  // myUSARTHandle is the handle returned
16215  // by the DRV_USART_Open function.
16216  // Client registers an event handler with driver
16217  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16218  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16219  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16220  myBuffer, MY_BUFFER_SIZE);
16221  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16222  {
16223  // Error handling here
16224  }
16225  // Event is received when
16226  // the buffer is processed.
16227  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16228  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16229  {
16230  // contextHandle points to myAppObj.
16231  switch(event)
16232  {
16233  case DRV_USART_BUFFER_EVENT_COMPLETE:
16234  // This means the data was transferred.
16235  break;
16236  case DRV_USART_BUFFER_EVENT_ERROR:
16237  // Error handling here.
16238  break;
16239  default:
16240  break;
16241  }
16242  }
16243  </code>
16244  Remarks:
16245  This function is thread safe in a RTOS application. It can be called from
16246  within the USART Driver Buffer Event Handler that is registered by the
16247  client. It should not be called in the event handler associated with another
16248  USART driver instance. It should not be called directly in an ISR.
16249 */
16250 
16251 void
16253  const DRV_HANDLE handle ,
16254  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16255  void * buffer ,
16256  const size_t size ) ;
16257 // *****************************************************************************
16258 /* Function:
16259  void DRV_USART_BufferEventHandlerSet
16260  (
16261  const DRV_HANDLE handle,
16262  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16263  const uintptr_t context
16264  )
16265  Summary:
16266  Allows a client to identify a buffer event handling function for the driver
16267  to call back when queued buffer transfers have finished.
16268  <p><b>Implementation:</b> Static/Dynamic</p>
16269  Description:
16270  This function allows a client to identify a buffer event handling function
16271  for the driver to call back when queued buffer transfers have finished.
16272  When a client calls either the DRV_USART_BufferAddRead or
16273  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16274  the buffer that was added to the driver's buffer queue. The driver will
16275  pass this handle back to the client by calling "eventHandler" function when
16276  the buffer transfer has completed.
16277  The event handler should be set before the client performs any "buffer add"
16278  operations that could generate events. The event handler once set, persists
16279  until the client closes the driver or sets another event handler (which
16280  could be a "NULL" pointer to indicate no callback).
16281  Precondition:
16282  The DRV_USART_Initialize routine must have been called for the specified
16283  USART driver instance.
16284  DRV_USART_Open must have been called to obtain a valid opened device handle.
16285  Parameters:
16286  handle - A valid open-instance handle, returned from the driver's
16287  open routine
16288  eventHandler - Pointer to the event handler function.
16289  context - The value of parameter will be passed back to the client
16290  unchanged, when the eventHandler function is called. It can
16291  be used to identify any client specific data object that
16292  identifies the instance of the client module (for example,
16293  it may be a pointer to the client module's state structure).
16294  Returns:
16295  None.
16296  Example:
16297  <code>
16298  // myAppObj is an application specific state data object.
16299  MY_APP_OBJ myAppObj;
16300  uint8_t mybuffer[MY_BUFFER_SIZE];
16301  DRV_USART_BUFFER_HANDLE bufferHandle;
16302  // myUSARTHandle is the handle returned
16303  // by the DRV_USART_Open function.
16304  // Client registers an event handler with driver. This is done once
16305  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16306  (uintptr_t)&myAppObj );
16307  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16308  myBuffer, MY_BUFFER_SIZE);
16309  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16310  {
16311  // Error handling here
16312  }
16313  // Event Processing Technique. Event is received when
16314  // the buffer is processed.
16315  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16316  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16317  {
16318  // The context handle was set to an application specific
16319  // object. It is now retrievable easily in the event handler.
16320  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16321  switch(event)
16322  {
16323  case DRV_USART_BUFFER_EVENT_COMPLETE:
16324  // This means the data was transferred.
16325  break;
16326  case DRV_USART_BUFFER_EVENT_ERROR:
16327  // Error handling here.
16328  break;
16329  default:
16330  break;
16331  }
16332  }
16333  </code>
16334  Remarks:
16335  If the client does not want to be notified when the queued buffer transfer
16336  has completed, it does not need to register a callback. This function is
16337  thread safe when called in a RTOS application.
16338 */
16339 
16340 void
16342  const DRV_HANDLE handle ,
16343  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16344  const uintptr_t context ) ;
16345 // *****************************************************************************
16346 /* Function:
16347  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16348  Summary:
16349  Removes a requested buffer from the queue.
16350  <p><b>Implementation:</b> Static/Dynamic</p>
16351  Description:
16352  This function removes a specified buffer from the queue.
16353  The client can use this function to delete
16354  1. An unwated stalled buffer.
16355  2. Queued buffers on timeout.
16356  or in any other use case.
16357  Precondition:
16358  The DRV_USART_Initialize routine must have been called for the specified
16359  USART driver instance.
16360  DRV_USART_Open must have been called to obtain a valid opened device handle.
16361  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16362  must have been called and a valid buffer handle returned.
16363  Parameters:
16364  bufferhandle - Handle of the buffer to delete.
16365  Returns:
16366  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16367  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16368  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16369  queue successfully.
16370  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16371  the queue because of mutex timeout in RTOS environment.
16372  Example:
16373  <code>
16374  // myAppObj is an application specific object.
16375  MY_APP_OBJ myAppObj;
16376  uint8_t mybuffer[MY_BUFFER_SIZE];
16377  DRV_USART_BUFFER_HANDLE bufferHandle;
16378  // myUSARTHandle is the handle returned
16379  // by the DRV_USART_Open function.
16380  // Client registers an event handler with driver. This is done once
16381  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16382  (uintptr_t)&myAppObj );
16383  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16384  myBuffer, MY_BUFFER_SIZE );
16385  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16386  {
16387  // Error handling here
16388  }
16389  // Event Processing Technique. Event is received when
16390  // the buffer is processed.
16391  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16392  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16393  {
16394  switch(event)
16395  {
16396  case DRV_USART_BUFFER_EVENT_COMPLETE:
16397  // This means the data was transferred.
16398  break;
16399  case DRV_USART_BUFFER_EVENT_ERROR:
16400  // Error handling here.
16401  break;
16402  default:
16403  break;
16404  }
16405  }
16406  // Timeout function, where remove queued buffer if it still exists.
16407  void APP_TimeOut(void)
16408  {
16409  DRV_USART_BUFFER_RESULT bufferResult;
16410  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16411  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16412  {
16413  //Buffer removed succesfully from the queue
16414  }
16415  else
16416  {
16417  //Either buffer is invalid or expired.
16418  //Or not able to acquire mutex in RTOS mode.
16419  }
16420  }
16421  </code>
16422  Remarks:
16423  This function is thread safe when used in a RTOS application.
16424 */
16425 
16428  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16429 // *****************************************************************************
16430 /* Function:
16431  size_t DRV_USART_BufferCompletedBytesGet
16432  (
16433  DRV_USART_BUFFER_HANDLE bufferHandle
16434  );
16435  Summary:
16436  Returns the number of bytes that have been processed for the
16437  specified buffer.
16438  <p><b>Implementation:</b> Static/Dynamic</p>
16439  Description:
16440  This function returns number of bytes that have been processed for the
16441  specified buffer. The client can use this function, in a case where the
16442  buffer has terminated due to an error, to obtain the number of bytes that
16443  have been processed. Or in any other use case.
16444  This function can be used for non-DMA buffer transfers only. It cannot be
16445  used when the USART driver is configured to use DMA.
16446  Precondition:
16447  The DRV_USART_Initialize routine must have been called for the specified
16448  USART driver instance.
16449  DRV_USART_Open must have been called to obtain a valid opened device handle.
16450  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16451  must have been called and a valid buffer handle returned.
16452  Parameters:
16453  bufferhandle - Handle for the buffer of which the processed number of bytes
16454  to be obtained.
16455  Returns:
16456  Returns the number of bytes that have been processed for this buffer.
16457  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16458  buffer handle.
16459  Example:
16460  <code>
16461  // myAppObj is an application specific object.
16462  MY_APP_OBJ myAppObj;
16463  uint8_t mybuffer[MY_BUFFER_SIZE];
16464  DRV_USART_BUFFER_HANDLE bufferHandle;
16465  // myUSARTHandle is the handle returned
16466  // by the DRV_USART_Open function.
16467  // Client registers an event handler with driver. This is done once
16468  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16469  (uintptr_t)&myAppObj );
16470  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16471  myBuffer, MY_BUFFER_SIZE );
16472  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16473  {
16474  // Error handling here
16475  }
16476  // Event Processing Technique. Event is received when
16477  // the buffer is processed.
16478  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16479  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16480  {
16481  // The context handle was set to an application specific
16482  // object. It is now retrievable easily in the event handler.
16483  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16484  size_t processedBytes;
16485  switch(event)
16486  {
16487  case DRV_USART_BUFFER_EVENT_COMPLETE:
16488  // This means the data was transferred.
16489  break;
16490  case DRV_USART_BUFFER_EVENT_ERROR:
16491  // Error handling here.
16492  // We can find out how many bytes were processed in this
16493  // buffer before the error occurred.
16494  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16495  break;
16496  default:
16497  break;
16498  }
16499  }
16500  </code>
16501  Remarks:
16502  This function is thread safe when used in a RTOS application.
16503 */
16504 
16505 size_t
16507  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16508 // *****************************************************************************
16509 /* Function:
16510  size_t DRV_USART_BufferProcessedSizeGet
16511  (
16512  DRV_USART_BUFFER_HANDLE bufferHandle
16513  );
16514  Summary:
16515  This API will be deprecated and not recommended to use.
16516  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16517  processed for the specified buffer.
16518  Description:
16519  None.
16520  Precondition:
16521  None.
16522  Parameters:
16523  None.
16524  Returns:
16525  None.
16526  Example:
16527  None.
16528  Remarks:
16529  None.
16530 */
16531 
16532 size_t
16534  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16535 // *****************************************************************************
16536 // *****************************************************************************
16537 // Section: USART Driver File System Model Routines
16538 // *****************************************************************************
16539 // *****************************************************************************
16540 // *****************************************************************************
16541 /* Function:
16542  size_t DRV_USART_Read
16543  (
16544  const DRV_HANDLE handle,
16545  void * buffer,
16546  const size_t numbytes
16547  )
16548  Summary:
16549  Reads data from the USART.
16550  <p><b>Implementation:</b> Static/Dynamic</p>
16551  Description:
16552  This routine reads data from the USART. This function is blocking if the
16553  driver was opened by the client for blocking operation. This function will
16554  not block if the driver was opened by the client for non blocking operation.
16555  If the ioIntent parameter at the time of opening the driver was
16556  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16557  until) numbytes of bytes have been received or if an error occurred. If there
16558  are buffers queued for receiving data, these buffers will be serviced first. The
16559  function will not return until the requested number of bytes have been read.
16560  If the ioIntent parameter at the time of opening the driver was
16561  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16562  bytes that were actually read. The function will not wait until numBytes of
16563  bytes have been read. If there are buffer queued for reading data, then the
16564  function will not block and will return immediately with 0 bytes read.
16565  Precondition:
16566  The DRV_USART_Initialize routine must have been called for the specified
16567  USART driver instance.
16568  DRV_USART_Open must have been called to obtain a valid opened device handle.
16569  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16570  the DRV_USART_Open call.
16571  Parameters:
16572  handle - A valid open-instance handle, returned from the driver's
16573  open routine
16574  buffer - Buffer into which the data read from the USART instance
16575  will be placed.
16576  numbytes - Total number of bytes that need to be read from the module
16577  instance (must be equal to or less than the size of the
16578  buffer)
16579  Returns:
16580  Number of bytes actually copied into the caller's buffer. Returns
16581  DRV_USART_READ_ERROR in case of an error.
16582  Example:
16583  <code>
16584  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16585  char myBuffer[MY_BUFFER_SIZE];
16586  unsigned int count;
16587  unsigned int total;
16588  total = 0;
16589  do
16590  {
16591  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16592  if(count == DRV_USART_READ_ERROR)
16593  {
16594  // There was an error. The DRV_USART_ErrorGet() function
16595  // can be called to find the exact error.
16596  }
16597  total += count;
16598  // Do something else...
16599  } while( total < MY_BUFFER_SIZE );
16600  </code>
16601  Remarks:
16602  This function is thread safe in a RTOS application. If the driver is
16603  configured for polled operation, this it will not support blocking operation
16604  in a bare metal (non-RTOS) application.
16605 */
16606 
16607 size_t
16608  DRV_USART_Read (
16609  const DRV_HANDLE handle ,
16610  void * buffer ,
16611  const size_t numbytes ) ;
16612 // *****************************************************************************
16613 /* Function:
16614  size_t DRV_USART_Write
16615  (
16616  const DRV_HANDLE handle,
16617  void * buffer,
16618  const size_t numbytes
16619  )
16620  Summary:
16621  Writes data to the USART.
16622  <p><b>Implementation:</b> Static/Dynamic</p>
16623  Description:
16624  This routine writes data to the USART. This function is blocking if the
16625  driver was opened by the client for blocking operation. This function will
16626  not block if the driver was opened by the client for non blocking operation.
16627  If the ioIntent parameter at the time of opening the driver was
16628  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16629  until) numbytes of bytes have been transmitted or if an error occurred. If
16630  there are buffers queued for writing, the function will wait until all the
16631  preceding buffers are completed. Ongoing buffer transmit operations will not
16632  be affected.
16633  If the ioIntent parameter at the time of opening the driver was
16634  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16635  bytes that were actually accepted for transmission. The function will not
16636  wait until numBytes of bytes have been transmitted. If there a buffers queued
16637  for transmit, the function will not wait and will return immediately with 0
16638  bytes.
16639  Precondition:
16640  The DRV_USART_Initialize routine must have been called for the specified
16641  USART driver instance.
16642  DRV_USART_Open must have been called to obtain a valid opened device handle.
16643  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16644  the DRV_USART_Open call.
16645  Parameters:
16646  handle - A valid open-instance handle, returned from the driver's
16647  open routine
16648  buffer - Buffer containing the data to written.
16649  numbytes - size of the buffer
16650  Returns:
16651  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16652  in case of an error.
16653  Example:
16654  <code>
16655  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16656  char myBuffer[MY_BUFFER_SIZE];
16657  int count;
16658  unsigned int total;
16659  total = 0;
16660  do
16661  {
16662  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16663  MY_BUFFER_SIZE - total);
16664  total += count;
16665  // Do something else...
16666  } while( total < MY_BUFFER_SIZE );
16667  </code>
16668  Remarks:
16669  This function is thread safe in a RTOS application. This function is thread
16670  safe in a RTOS application. If the driver is configured for polled
16671  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16672  application.
16673 */
16674 
16675 size_t
16676  DRV_USART_Write (
16677  const DRV_HANDLE handle ,
16678  void * buffer ,
16679  const size_t numbytes ) ;
16680 // *****************************************************************************
16681 /* Function:
16682  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16683  Summary:
16684  Returns the transmitter and receiver transfer status.
16685  <p><b>Implementation:</b> Static/Dynamic</p>
16686  Description:
16687  This returns the transmitter and receiver transfer status.
16688  Precondition:
16689  The DRV_USART_Initialize routine must have been called for the specified
16690  USART driver instance.
16691  DRV_USART_Open must have been called to obtain a valid opened device handle.
16692  Parameters:
16693  handle - A valid open-instance handle, returned from the driver's
16694  open routine
16695  Returns:
16696  A DRV_USART_TRANSFER_STATUS value describing the current status
16697  of the transfer.
16698  Example:
16699  <code>
16700  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16701  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16702  {
16703  // Data has been received that can be read
16704  }
16705  </code>
16706  Remarks:
16707  The returned status may contain a value with more than one of the bits
16708  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16709  should perform an "AND" with the bit of interest and verify if the result is
16710  non-zero (as shown in the example) to verify the desired status bit. This
16711  function is thread safe when called in a RTOS application.
16712 */
16713 
16716  const DRV_HANDLE handle ) ;
16717 // *****************************************************************************
16718 // *****************************************************************************
16719 // Section: USART Driver Byte Model Routines
16720 // *****************************************************************************
16721 // *****************************************************************************
16722 // *****************************************************************************
16723 /* Function:
16724  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16725  Summary:
16726  Reads a byte of data from the USART.
16727  <p><b>Implementation:</b> Static/Dynamic</p>
16728  Description:
16729  This routine reads a byte of data from the USART.
16730  Precondition:
16731  The DRV_USART_Initialize routine must have been called for the specified
16732  USART driver instance.
16733  DRV_USART_Open must have been called to obtain a valid opened device handle.
16734  The transfer status should be checked to see if the receiver is not empty
16735  before calling this function.
16736  Parameters:
16737  handle - A valid open-instance handle, returned from the driver's
16738  open routine
16739  Returns:
16740  A data byte received by the driver.
16741  Example:
16742  <code>
16743  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16744  char myBuffer[MY_BUFFER_SIZE];
16745  unsigned int numBytes;
16746  numBytes = 0;
16747  do
16748  {
16749  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16750  {
16751  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16752  }
16753  // Do something else...
16754  } while( numBytes < MY_BUFFER_SIZE);
16755  </code>
16756  Remarks:
16757  This function is thread safe when called in a RTOS application. Note that
16758  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16759  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16760  DRV_USART_Write functions in a application. Calling the
16761  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16762  processing of any queued buffers.
16763 */
16764 
16765 uint8_t
16767  const DRV_HANDLE handle ) ;
16768 // *****************************************************************************
16769 /* Function:
16770  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16771  Summary:
16772  Writes a byte of data to the USART.
16773  <p><b>Implementation:</b> Static/Dynamic</p>
16774  Description:
16775  This routine writes a byte of data to the USART.
16776  Precondition:
16777  The DRV_USART_Initialize routine must have been called for the specified
16778  USART driver instance.
16779  DRV_USART_Open must have been called to obtain a valid opened device handle.
16780  The transfer status should be checked to see if transmitter is not full
16781  before calling this function.
16782  Parameters:
16783  handle - A valid open-instance handle, returned from the driver's
16784  open routine
16785  byte - Data byte to write to the USART
16786  Returns:
16787  None.
16788  Example:
16789  <code>
16790  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16791  char myBuffer[MY_BUFFER_SIZE];
16792  unsigned int numBytes;
16793  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16794  numBytes = 0;
16795  while( numBytes < MY_BUFFER_SIZE );
16796  {
16797  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16798  {
16799  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16800  }
16801  // Do something else...
16802  }
16803  </code>
16804  Remarks:
16805  This function is thread safe when called in a RTOS application. Note that
16806  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16807  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16808  DRV_USART_Write functions in a application. Calling the
16809  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16810  processing of any queued buffers.
16811 */
16812 
16813 void
16815  const DRV_HANDLE handle ,
16816  const uint8_t byte ) ;
16817 // *****************************************************************************
16818 /* Function:
16819  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16820  Summary:
16821  Returns the size of the receive buffer.
16822  <p><b>Implementation:</b> Static/Dynamic</p>
16823  Description:
16824  This routine returns the size of the receive buffer.
16825  Precondition:
16826  The DRV_USART_Initialize routine must have been called for the specified
16827  USART driver instance.
16828  DRV_USART_Open must have been called to obtain a valid opened device handle.
16829  Parameters:
16830  handle - A valid open-instance handle, returned from the driver's
16831  open routine
16832  Returns:
16833  Size of the driver's receive buffer, in bytes.
16834  Example:
16835  <code>
16836  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16837  const uint8_t readBuffer[5];
16838  unsigned int size, numBytes = 0;
16839  unsigned int readbufferLen = sizeof(readBuffer);
16840  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16841  // Do something based on the receiver buffer size
16842  </code>
16843  Remarks:
16844  Does not account for client queued buffers. This function is thread safe
16845  when called in a RTOS application.
16846 */
16847 
16848 unsigned int
16850  const DRV_HANDLE handle ) ;
16851 // *****************************************************************************
16852 /* Function:
16853  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16854  Summary:
16855  Returns the size of the transmit buffer.
16856  <p><b>Implementation:</b> Static/Dynamic</p>
16857  Description:
16858  This routine returns the size of the transmit buffer and can be used by the
16859  application to determine the number of bytes to write with the
16860  DRV_USART_WriteByte function.
16861  Precondition:
16862  The DRV_USART_Initialize routine must have been called for the specified
16863  USART driver instance.
16864  DRV_USART_Open must have been called to obtain a valid opened device handle.
16865  Parameters:
16866  handle - A valid open-instance handle, returned from the driver's
16867  open routine
16868  Returns:
16869  Size of the driver's transmit buffer, in bytes.
16870  Examples:
16871  <code>
16872  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16873  const uint8_t writeBuffer[5];
16874  unsigned int size, numBytes = 0;
16875  unsigned int writeBufferLen = sizeof(writeBuffer);
16876  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16877  // Do something based on the transmitter buffer size
16878  </code>
16879  Remarks:
16880  Does not account for client queued buffers. This function is thread safe
16881  when used in a RTOS application.
16882 */
16883 
16884 unsigned int
16886  const DRV_HANDLE handle ) ;
16887 // *****************************************************************************
16888 /* Function:
16889  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16890  Summary:
16891  Provides the status of the driver's receive buffer.
16892  <p><b>Implementation:</b> Static/Dynamic</p>
16893  Description:
16894  This routine indicates if the driver's receiver buffer is empty. This
16895  function can be used in conjunction with the DRV_USART_Read and
16896  DRV_USART_ReadByte functions.
16897  Precondition:
16898  The DRV_USART_Initialize routine must have been called for the specified
16899  USART driver instance.
16900  DRV_USART_Open must have been called to obtain a valid opened device handle.
16901  Parameters:
16902  handle - A valid open-instance handle, returned from the driver's
16903  open routine
16904  Returns:
16905  true - if the driver's receive buffer is empty
16906  false - if the driver's receive buffer is not empty
16907  Example:
16908  <code>
16909  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16910  char myBuffer[MY_BUFFER_SIZE];
16911  unsigned int numBytes;
16912  numBytes = 0;
16913  while( numBytes < MY_BUFFER_SIZE );
16914  {
16915  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16916  {
16917  if( numBytes < MY_BUFFER_SIZE )
16918  {
16919  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16920  }
16921  else
16922  {
16923  break;
16924  }
16925  }
16926  // Do something else while more data is received.
16927  }
16928  </code>
16929  Remarks:
16930  Does not account for client queued buffers. This function is safe thread
16931  safe when used in a RTOS application.
16932 */
16933 
16934 bool
16936  const DRV_HANDLE handle ) ;
16937 // *****************************************************************************
16938 /* Function:
16939  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16940  Summary:
16941  Provides the status of the driver's transmit buffer.
16942  <p><b>Implementation:</b> Static/Dynamic</p>
16943  Description:
16944  This routine identifies if the driver's transmit buffer is full or not. This
16945  function can be used in conjunction with the DRV_USART_Write and
16946  DRV_USART_WriteByte functions.
16947  Precondition:
16948  The DRV_USART_Initialize routine must have been called for the specified
16949  USART driver instance.
16950  DRV_USART_Open must have been called to obtain a valid opened device handle.
16951  Parameters:
16952  handle - A valid open-instance handle, returned from the driver's
16953  open routine
16954  Returns:
16955  true - if the transmit buffer is full
16956  false - if the transmit buffer is not full
16957  Example:
16958  <code>
16959  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16960  unsigned int numBytes;
16961  int bytesToWrite;
16962  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16963  int writebufferLen = strlen((char *)writeBuffer);
16964  numBytes = 0;
16965  while( numBytes < writebufferLen )
16966  {
16967  if (DRV_USART_TransmitBufferisFull())
16968  {
16969  // Do something else until there is some room in the driver's Transmit buffer.
16970  }
16971  else
16972  {
16973  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16974  }
16975  }
16976  </code>
16977  Remarks:
16978  Does not account for client queued buffers. This function is thread safe
16979  when called in a RTOS application.
16980 */
16981 
16982 bool
16984  const DRV_HANDLE handle ) ;
16985 // *****************************************************************************
16986 /* Function:
16987  void DRV_USART_ByteTransmitCallbackSet
16988  (
16989  const SYS_MODULE_INDEX index,
16990  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16991  )
16992  Summary:
16993  Registers a callback function for byte transmit event.
16994  Description:
16995  This function allows a transmit callback function to be registered with the
16996  driver. The callback function is invoked when a byte has been transmitted
16997  using DRV_USART_WriteByte () function.
16998  The callback function should be registered with the driver prior to any
16999  writes to the driver. The callback functionality is available only in the
17000  interrupt mode of operation. The driver clears the interrupt after invoking
17001  the callback function.
17002  Precondition:
17003  The DRV_USART_Initialize routine must have been called for the specified
17004  USART driver instance.
17005  Parameters:
17006  index - Identifier for the object instance to be opened
17007  eventHandler - Pointer to the event handler function.
17008  Returns:
17009  None.
17010  Example:
17011  <code>
17012  // myAppObj is an application specific state data object.
17013  MY_APP_OBJ myAppObj;
17014  uint8_t mybuffer[MY_BUFFER_SIZE];
17015  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17016  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17017  (uintptr_t)&myAppObj );
17018  // Register an event handler with driver. This is done once
17019  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17020  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17021  // Event Processing Technique. Event is received when
17022  // the byte is transmitted.
17023  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17024  {
17025  // Byte has been transmitted. Handle the event.
17026  }
17027  </code>
17028  Remarks:
17029  None
17030 */
17031 
17032 void
17034  const SYS_MODULE_INDEX index ,
17035  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17036 // *****************************************************************************
17037 /* Function:
17038  void DRV_USART_ByteReceiveCallbackSet
17039  (
17040  const SYS_MODULE_INDEX index,
17041  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17042  )
17043  Summary:
17044  Registers receive callback function for byte receive event.
17045  Description:
17046  This function allows a receive callback function to be registered with the
17047  driver. The callback function is invoked when a byte has been received. The
17048  received byte can then be read using DRV_USART_ReadByte() function.
17049  The callback function should be registered with the driver as part of the
17050  initialization. The callback functionality is available only in the
17051  interrupt mode of operation. The driver clears the interrupt after invoking
17052  the callback function.
17053  Precondition:
17054  The DRV_USART_Initialize routine must have been called for the specified
17055  USART driver instance.
17056  Parameters:
17057  index - Identifier for the object instance to be opened
17058  eventHandler - Pointer to the event handler function.
17059  Returns:
17060  None.
17061  Example:
17062  <code>
17063  // myAppObj is an application specific state data object.
17064  MY_APP_OBJ myAppObj;
17065  uint8_t mybuffer[MY_BUFFER_SIZE];
17066  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17067  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17068  (uintptr_t)&myAppObj );
17069  // Register an event handler with driver. This is done once
17070  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17071  // Event Processing Technique. Event is received when
17072  // a byte is received.
17073  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17074  {
17075  // Byte has been Received. Handle the event.
17076  // Read byte using DRV_USART_ReadByte ()
17077  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17078  // check if the receiver buffer is empty.
17079  }
17080  </code>
17081  Remarks:
17082  None
17083 */
17084 
17085 void
17087  const SYS_MODULE_INDEX index ,
17088  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17089 // *****************************************************************************
17090 /* Function:
17091  void DRV_USART_ByteErrorCallbackSet
17092  (
17093  const SYS_MODULE_INDEX index,
17094  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17095  )
17096  Summary:
17097  Registers callback to handle for byte error events.
17098  Description:
17099  This function allows a callback function to be registered with the driver
17100  to handle the error events occurring in the transmit/receive path during
17101  byte transfers.
17102  The callback function should be registered as part of the initialization.
17103  The callback functionality is available only in the interrupt mode of
17104  operation. The driver clears the interrupt after invoking the callback
17105  function.
17106  Precondition:
17107  The DRV_USART_Initialize routine must have been called for the specified
17108  USART driver instance.
17109  Parameters:
17110  index - Identifier for the object instance to be opened
17111  eventHandler - Pointer to the event handler function.
17112  Returns:
17113  None.
17114  Example:
17115  <code>
17116  // myAppObj is an application specific state data object.
17117  MY_APP_OBJ myAppObj;
17118  uint8_t mybuffer[MY_BUFFER_SIZE];
17119  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17120  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17121  (uintptr_t)&myAppObj );
17122  // Register an event handler with driver. This is done once
17123  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17124  // Event Processing Technique.
17125  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17126  {
17127  // Error has occurred. Handle the event.
17128  }
17129  </code>
17130  Remarks:
17131  None
17132 */
17133 
17134 void
17136  const SYS_MODULE_INDEX index ,
17137  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17138 // *****************************************************************************
17139 // *****************************************************************************
17140 // Section: USART Driver Setup and Status Routines
17141 // *****************************************************************************
17142 // *****************************************************************************
17143 // *****************************************************************************
17144 /* Function:
17145  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17146  Summary:
17147  This function returns the error(if any) associated with the last client
17148  request.
17149  <p><b>Implementation:</b> Static/Dynamic</p>
17150  Description:
17151  This function returns the error(if any) associated with the last client
17152  request. DRV_USART_Read and DRV_USART_Write will update the client
17153  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17154  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17155  call this function to know the error cause. The error status will be updated
17156  on every operation and should be read frequently (ideally immediately after
17157  the driver operation has completed) to know the relevant error status.
17158  Precondition:
17159  The DRV_USART_Initialize routine must have been called for the specified
17160  USART driver instance.
17161  DRV_USART_Open must have been called to obtain a valid opened device handle.
17162  Parameters:
17163  bufferhandle - Handle of the buffer of which the processed number of bytes
17164  to be obtained.
17165  Returns:
17166  A DRV_USART_ERROR type indicating last known error status.
17167  Example:
17168  <code>
17169  // myAppObj is an application specific object.
17170  MY_APP_OBJ myAppObj;
17171  uint8_t mybuffer[MY_BUFFER_SIZE];
17172  DRV_USART_BUFFER_HANDLE bufferHandle;
17173  // myUSARTHandle is the handle returned
17174  // by the DRV_USART_Open function.
17175  // Client registers an event handler with driver. This is done once.
17176  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17177  (uintptr_t)&myAppObj );
17178  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17179  myBuffer, MY_BUFFER_SIZE );
17180  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17181  {
17182  // Error handling here
17183  }
17184  // Event Processing Technique. Event is received when
17185  // the buffer is processed.
17186  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17187  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17188  {
17189  // The context handle was set to an application specific
17190  // object. It is now retrievable easily in the event handler.
17191  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17192  size_t processedBytes;
17193  switch(event)
17194  {
17195  case DRV_USART_BUFFER_EVENT_COMPLETE:
17196  // This means the data was transferred.
17197  break;
17198  case DRV_USART_BUFFER_EVENT_ERROR:
17199  // Error handling here.
17200  // We can find out how many bytes were processed in this
17201  // buffer before the error occurred. We can also find
17202  // the error cause.
17203  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17204  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17205  {
17206  // There was an receive over flow error.
17207  // Do error handling here.
17208  }
17209  break;
17210  default:
17211  break;
17212  }
17213  }
17214  </code>
17215  Remarks:
17216  It is the client's responsibility to make sure that the error status is
17217  obtained frequently. The driver will update the client error status
17218  regardless of whether this has been examined by the client. This function
17219  is thread safe when used in a RTOS application.
17220 */
17221 
17224  const DRV_HANDLE client ) ;
17225 // *****************************************************************************
17226 /* Function:
17227  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17228  Summary:
17229  This function changes the USART module baud to the specified value.
17230  <p><b>Implementation:</b> Static/Dynamic</p>
17231  Description:
17232  This function changes the USART module baud to the specified value. Any
17233  queued buffer requests will be processed at the updated baud. The USART
17234  driver operates at the baud specified in DRV_USART_Initialize function
17235  unless the DRV_USART_BaudSet function is called to change the baud.
17236  Precondition:
17237  The DRV_USART_Initialize routine must have been called for the specified
17238  USART driver instance.
17239  DRV_USART_Open must have been called to obtain a valid opened device handle.
17240  Parameters:
17241  handle - client handle returned by DRV_USART_Open function.
17242  baud - desired baud.
17243  Returns:
17244  None.
17245  Example:
17246  <code>
17247  // myUSARTHandle is the handle returned
17248  // by the DRV_USART_Open function.
17249  DRV_USART_BaudSet(myUSARTHandle, 9600);
17250  </code>
17251  Remarks:
17252  The implementation of this function, in this release of the driver, changes
17253  the baud immediately. This may interrupt on-going data transfer. It is
17254  recommended that the driver be opened exclusively if this function is to be
17255  called. This function is thread safe when used in a RTOS application.
17256 */
17257 
17260  const DRV_HANDLE client ,
17261  uint32_t baud ) ;
17262 // *****************************************************************************
17263 /* Function:
17264  void DRV_USART_LineControlSet
17265  (
17266  DRV_HANDLE client,
17267  DRV_USART_LINE_CONTROL lineControl
17268  );
17269  Summary:
17270  This function changes the USART module line control to the specified value.
17271  <p><b>Implementation:</b> Static/Dynamic</p>
17272  Description:
17273  This function changes the USART module line control parameters to the
17274  specified value. Any queued buffer requests will be processed at the
17275  updated line control parameters. The USART driver operates at the line
17276  control parameters specified in DRV_USART_Initialize function unless the
17277  DRV_USART_LineControlSet function is called to change the line control
17278  parameters.
17279  Precondition:
17280  The DRV_USART_Initialize routine must have been called for the specified
17281  USART driver instance.
17282  DRV_USART_Open must have been called to obtain a valid opened device handle.
17283  Parameters:
17284  handle - client handle returned by DRV_USART_Open function.
17285  lineControl - line control parameters.
17286  Returns:
17287  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17288  DRV_HANDLE_INVALID if the client handle is not valid.
17289  Example:
17290  <code>
17291  // myUSARTHandle is the handle returned
17292  // by the DRV_USART_Open function.
17293  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17294  </code>
17295  Remarks:
17296  The implementation of this function, in this release of the driver, changes
17297  the line control immediately. This may interrupt on-going data transfer. It
17298  is recommended that the driver be opened exclusively if this function is to
17299  be called. This function is thread safe when called in a RTOS application.
17300 */
17301 
17304  const DRV_HANDLE client ,
17305  const DRV_USART_LINE_CONTROL lineControl ) ;
17306 //DOM-IGNORE-BEGIN
17307 //DOM-IGNORE-END
17308  // #ifndef _DRV_USART_H
17309 /*******************************************************************************
17310  End of File
17311 */
17312 
17313 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17314 /* CLOSE_FILE Include File */
17315 
17316 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17317 /*******************************************************************************
17318  USART Driver Variant Mapping
17319  Company:
17320  Microchip Technology Inc.
17321  File Name:
17322  drv_usart_variant_mapping.h
17323  Summary:
17324  USART Driver Variant Mapping
17325  Description:
17326  This file provides feature and build variant mapping macros allowing the
17327  driver to easily be built with different implementation variations based
17328  on static build-time configuration selections.
17329 *******************************************************************************/
17330 //DOM-IGNORE-BEGIN
17331 /*******************************************************************************
17332 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17333 Microchip licenses to you the right to use, modify, copy and distribute
17334 Software only when embedded on a Microchip microcontroller or digital signal
17335 controller that is integrated into your product or third party product
17336 (pursuant to the sublicense terms in the accompanying license agreement).
17337 You should refer to the license agreement accompanying this Software for
17338 additional information regarding your rights and obligations.
17339 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17340 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17341 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17342 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17343 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17344 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17345 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17346 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17347 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17348 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17349 *******************************************************************************/
17350 //DOM-IGNORE-END
17351 #ifndef _DRV_USART_FEATURE_MAPPING_H
17352 #define _DRV_USART_FEATURE_MAPPING_H
17353 // *****************************************************************************
17354 // *****************************************************************************
17355 // Section: Interrrupt Variations
17356 // *****************************************************************************
17357 // *****************************************************************************
17358 /* Mapping of the interrupt mode variations
17359 */
17360  /* Driver is configured for polled mode */
17361 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17362 #define _DRV_USART_InterruptSourceEnable( source )
17363 #define _DRV_USART_InterruptSourceDisable( source ) false
17364 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17365 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17366 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17367 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17368 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17369  /* This means the driver is being built in a baremetal application.
17370  We cannot let a client open the driver in blocking mode */
17371 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17372 // *****************************************************************************
17373 // *****************************************************************************
17374 // Section: Buffer Queue support
17375 // *****************************************************************************
17376 // *****************************************************************************
17377 /* Mapping of macros for buffer queue support
17378 */
17379  /* We dont need buffer queues or byte model support */
17380 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17381 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17382 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17383 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17384 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17385 // *****************************************************************************
17386 // *****************************************************************************
17387 // Initializtion Parameter Static Overrides
17388 // *****************************************************************************
17389 // *****************************************************************************
17390  //_DRV_USART_FEATURE_MAPPING_H
17391 /*******************************************************************************
17392  End of File
17393 */
17394 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17395 /* CLOSE_FILE Include File */
17396 
17397 #include "system/clk/sys_clk.h"
17398 #include "system/int/sys_int.h"
17399 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17400 /*******************************************************************************
17401  Debug System Services Library Header
17402  Company:
17403  Microchip Technology Inc.
17404 
17405  File Name:
17406  sys_debug.h
17407  Summary:
17408  Defines the common debug definitions and interfaces used by MPLAB Harmony
17409  libraries to report errors and debug information to the user.
17410  Description:
17411  This header file defines the common debug definitions and interface macros
17412  (summary below) and prototypes used by MPLAB Harmony libraries to report
17413  errors and debug information to the user.
17414  *******************************************************************************/
17415 //DOM-IGNORE-BEGIN
17416 /*******************************************************************************
17417 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17418 Microchip licenses to you the right to use, modify, copy and distribute
17419 Software only when embedded on a Microchip microcontroller or digital signal
17420 controller that is integrated into your product or third party product
17421 (pursuant to the sublicense terms in the accompanying license agreement).
17422 You should refer to the license agreement accompanying this Software for
17423 additional information regarding your rights and obligations.
17424 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17425 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17426 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17427 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17428 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17429 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17430 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17431 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17432 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17433 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17434  *******************************************************************************/
17435 //DOM-IGNORE-END
17436 #ifndef _SYS_DEBUG_H
17437 #define _SYS_DEBUG_H
17438 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17439  /* LDRA full path */
17440 // This should be defined in system_config.h. It is added here as a build safe-guard.
17441 #define SYS_DEBUG_BUFFER_DMA_READY
17442 // *****************************************************************************
17443 // *****************************************************************************
17444 // Section: SYS DEBUG Data Types
17445 // *****************************************************************************
17446 // *****************************************************************************
17447 // *****************************************************************************
17448 /* SYS_ERROR_LEVEL enumeration
17449  Summary:
17450  System error message priority levels.
17451  Description:
17452  This enumeration defines the supported system error message priority values.
17453  Remarks:
17454  Used by debug message macros to compare individual message priority against
17455  a global system-wide error message priority level to determine if an
17456  individual message should be displayed.
17457 */
17458 
17459 typedef
17460  enum
17461  {
17462  /* Errors that have the potential to cause a system crash. */
17464  /* Errors that have the potential to cause incorrect behavior. */
17466  /* Warnings about potentially unexpected behavior or side effects. */
17468  /* Information helpful to understanding potential errors and warnings. */
17470  /* Verbose information helpful during debugging and testing. */
17472  } SYS_ERROR_LEVEL ;
17473 // DOM-IGNORE-BEGIN
17474 // *****************************************************************************
17475 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17476  SYS_DEBUG_ErrorLevelSet functions to access this value.
17477 */
17478 
17479 extern SYS_ERROR_LEVEL
17480  gblErrLvl ;
17481 // DOM-IGNORE-END
17482 // *****************************************************************************
17483 /* SYS Debug Module Index Number
17484  Summary:
17485  Debug System Service index.
17486  Description:
17487  This constant defines a symbolic name for the debug system service index.
17488  Remarks:
17489  There can only be a single debug system service instance in the system.
17490 */
17491 #define SYS_DEBUG_INDEX_0 0
17492 // *****************************************************************************
17493 /* SYS Debug Initialize structure
17494  Summary:
17495  Defines the data required to initialize the debug system service.
17496  Description:
17497  This structure defines the data required to initialize the debug system
17498  service.
17499  Remarks:
17500  None.
17501 */
17502 
17503 typedef
17504  struct
17505  {
17506  /* System module initialization */
17507  SYS_MODULE_INIT moduleInit ;
17508  /* Initial system error level setting. */
17509  SYS_ERROR_LEVEL errorLevel ;
17510  /* Console index to receive debug messages */
17511  SYS_MODULE_INDEX consoleIndex ;
17512  } SYS_DEBUG_INIT ;
17513 // *****************************************************************************
17514 // *****************************************************************************
17515 // Section: SYS DEBUG Functions
17516 // *****************************************************************************
17517 // *****************************************************************************
17518 // *****************************************************************************
17519 /* Function:
17520  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17521  const SYS_MODULE_INIT * const init )
17522  Summary:
17523  Initializes the global error level and specific module instance.
17524  Description:
17525  This function initializes the global error level. It also initializes any
17526  internal system debug module data structures.
17527  Precondition:
17528  None.
17529  Parameters:
17530  index - Index for the instance to be initialized
17531  init - Pointer to a data structure containing any data necessary
17532  to initialize the debug service. This pointer may be null
17533  if no data is required because static overrides have
17534  been provided.
17535  Returns:
17536  If successful, returns a valid handle to an object. Otherwise, it
17537  returns SYS_MODULE_OBJ_INVALID.
17538  Example:
17539  <code>
17540  SYS_MODULE_OBJ objectHandle;
17541  SYS_DEBUG_INIT debugInit =
17542  {
17543  .moduleInit = {0},
17544  .errorLevel = SYS_ERROR_DEBUG,
17545  };
17546  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17547  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17548  {
17549  // Handle error
17550  }
17551  </code>
17552  Remarks:
17553  This routine should only be called once during system initialization. If the
17554  system was already initialized it safely returns without causing any disturbance.
17555 */
17556 
17557 SYS_MODULE_OBJ
17559  const SYS_MODULE_INDEX index ,
17560  const SYS_MODULE_INIT * const init ) ;
17561 // *****************************************************************************
17562 /* Function:
17563  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17564  const SYS_MODULE_INIT * const init )
17565  Summary:
17566  Reinitializes and refreshes the data structure for the instance of the
17567  Debug module.
17568  Description:
17569  This function reinitializes and refreshes the data structure for the instance
17570  of the Debug module using the supplied data.
17571  Precondition:
17572  The SYS_DEBUG_Initialize function should have been called before calling
17573  this function.
17574  Parameters:
17575  object - Identifies the SYS DEBUG Object returned by the Initialize
17576  interface
17577  init - Pointer to the data structure containing any data
17578  necessary to initialize the hardware
17579  Returns:
17580  None
17581  Example:
17582  <code>
17583  SYS_MODULE_OBJ objectHandle;
17584  // Populate the console initialization structure
17585  SYS_DEBUG_INIT dbgInit =
17586  {
17587  .moduleInit = {0},
17588  .errorLevel = SYS_ERROR_DEBUG,
17589  };
17590  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17591  </code>
17592  Remarks:
17593  This operation uses the same initialization data structure as the
17594  SYS_DEBUG_Initialize operation. This function can be called multiple times
17595  to reinitialize the module.
17596 */
17597 
17598 void
17600  SYS_MODULE_OBJ object ,
17601  const SYS_MODULE_INIT * const init ) ;
17602 // *****************************************************************************
17603 /* Function:
17604  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17605  Summary:
17606  Deinitializes the specific module instance of the Debug module.
17607  Description:
17608  This function deinitializes the specific module instance disabling its
17609  operation (and any hardware for driver modules). Resets all of the internal
17610  data structures and fields for the specified instance to the default settings.
17611  Precondition:
17612  The SYS_DEBUG_Initialize function should have been called before calling
17613  this function.
17614  Parameters:
17615  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17616  Returns:
17617  None.
17618  Example:
17619  <code>
17620  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17621  SYS_DEBUG_Deinitialize (object);
17622  </code>
17623  Remarks:
17624  Once the Initialize operation has been called, the Deinitialize
17625  operation must be called before the Initialize operation can be called
17626  again.
17627 */
17628 
17629 void
17631  SYS_MODULE_OBJ object ) ;
17632 // *****************************************************************************
17633 /* Function:
17634  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17635  Summary:
17636  Maintains the debug module's state machine.
17637  Description:
17638  This function is used to maintain the debug module's internal state
17639  machine and implement its ISR for interrupt-driven implementations.
17640  Precondition:
17641  The SYS_DEBUG_Initialize function must have been called for the specified
17642  CONSOLE driver instance.
17643  Parameters:
17644  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17645  Returns:
17646  None.
17647  Example:
17648  <code>
17649  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17650  while (true)
17651  {
17652  SYS_DEBUG_Tasks (object);
17653  // Do other tasks
17654  }
17655  </code>
17656  Remarks:
17657  This function is normally not called directly by an application. It is
17658  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17659  ISR.
17660 */
17661 
17662 void
17663  SYS_DEBUG_Tasks (
17664  SYS_MODULE_OBJ object ) ;
17665 // *****************************************************************************
17666 /* Function:
17667  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17668  Summary:
17669  Returns status of the specific instance of the debug service module.
17670  Description:
17671  This function returns the status of the specific debug service module
17672  instance.
17673  Precondition:
17674  The SYS_CONSOLE_Initialize function should have been called before calling
17675  this function.
17676  Parameters:
17677  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17678  Returns:
17679  * SYS_STATUS_READY - Indicates that the module is running and
17680  ready to service requests. Any value greater
17681  than SYS_STATUS_READY is also a normal
17682  running state in which the module is ready
17683  to accept new operations.
17684  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17685  previous system level operation and cannot
17686  start another.
17687  * SYS_STATUS_ERROR - Indicates that the module is in an error
17688  state. Any value less than SYS_STATUS_ERROR
17689  is also an error state.
17690  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17691  initialized or has been deinitialized.
17692  Example:
17693  <code>
17694  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17695  SYS_STATUS debugStatus;
17696  debugStatus = SYS_DEBUG_Status (object);
17697  if (SYS_STATUS_ERROR >= debugStatus)
17698  {
17699  // Handle error
17700  }
17701  </code>
17702  Remarks:
17703  None.
17704 */
17705 
17706 SYS_STATUS
17708  SYS_MODULE_OBJ object ) ;
17709 // *****************************************************************************
17710 // *****************************************************************************
17711 // Section: SYS DEBUG Console Functions
17712 // *****************************************************************************
17713 // *****************************************************************************
17714 // *****************************************************************************
17715 /* Function:
17716  SYS_DEBUG_Message( const char* message );
17717  Summary:
17718  Prints a message to the console regardless of the system error level.
17719  Description:
17720  This function prints a message to the console regardless of the system
17721  error level. It can be used as an implementation of the SYS_MESSAGE and
17722  SYS_DEBUG_MESSAGE macros.
17723  Precondition:
17724  SYS_DEBUG_Initialize must have returned a valid object handle and the
17725  SYS_DEBUG_Tasks function must be called by the system to complete the
17726  message request.
17727  Parameters:
17728  message - Pointer to a message string to be displayed.
17729  Returns:
17730  None.
17731  Example:
17732  <code>
17733  // In system_config.h:
17734 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17735 
17736  // In source (.c) files:
17737  SYS_MESSAGE("My Message\n\r");
17738  </code>
17739  Remarks:
17740  Do not call this function directly. Call the SYS_MESSAGE or
17741  SYS_DEBUG_MESSAGE macros instead.
17742 
17743  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17744  the messages and message function calls from the source code. To access
17745  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17746  override the definitions of the individual macros.
17747 */
17748 
17749 void
17751  const char * message ) ;
17752 // *****************************************************************************
17753 /* Function:
17754  SYS_DEBUG_Print( const char* format, ... )
17755  Summary:
17756  Formats and prints a message with a variable number of arguments to the
17757  console regardless of the system error level.
17758  Description:
17759  This function formats and prints a message with a variable number of
17760  arguments to the console regardless of the system error level. It can be
17761  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17762  Precondition:
17763  SYS_DEBUG_Initialize must have returned a valid object handle and the
17764  SYS_DEBUG_Tasks function must be called by the system to complete the
17765  message request.
17766  Parameters:
17767  format - Pointer to a buffer containing the format string for
17768  the message to be displayed.
17769  ... - Zero or more optional parameters to be formated as
17770  defined by the format string.
17771  Returns:
17772  None.
17773  Example:
17774  <code>
17775  // In system_config.h
17776 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17777 
17778  // In source code
17779  int result;
17780 
17781  result = SomeOperation();
17782  if (result > MAX_VALUE)
17783  {
17784  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17785  }
17786  </code>
17787  Remarks:
17788  The format string and arguments follow the printf convention.
17789 
17790  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17791  macros instead.
17792 
17793  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17794  messages and message function calls. To access and utilize the messages,
17795  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17796  individual macros.
17797 */
17798 
17799 void
17800  SYS_DEBUG_Print (
17801  const char * format ,
17802  ... ) ;
17803 // *****************************************************************************
17804 /* Function:
17805  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17806  Summary:
17807  Sets the global system error reporting level.
17808  Description:
17809  This function sets the global system error reporting level.
17810 
17811  Precondition:
17812  SYS_DEBUG_Initialize must have returned a valid object handle.
17813  Parameters:
17814  level - The desired system error level.
17815  Returns:
17816  None.
17817  Example:
17818  <code>
17819  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17820  </code>
17821  Remarks:
17822  None.
17823 */
17824 
17825 void
17827  SYS_ERROR_LEVEL level ) ;
17828 // *****************************************************************************
17829 /* Function:
17830  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17831  Summary:
17832  Returns the global system Error reporting level.
17833  Description:
17834  This function returns the global System Error reporting level.
17835 
17836  Precondition:
17837  SYS_DEBUG_Initialize must have returned a valid object handle.
17838  Parameters:
17839  None.
17840  Returns:
17841  The global System Error Level.
17842  Example:
17843  <code>
17844  SYS_ERROR_LEVEL level;
17845 
17846  level = SYS_DEBUG_ErrorLevelGet();
17847  </code>
17848  Remarks:
17849  None.
17850 */
17851 
17853  SYS_DEBUG_ErrorLevelGet ( void ) ;
17854 // *****************************************************************************
17855 // *****************************************************************************
17856 // Section: SYS DEBUG Macros
17857 // *****************************************************************************
17858 // *****************************************************************************
17859 // *****************************************************************************
17860 /* Macro:
17861  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17862  Summary:
17863  Prints a debug message if the specified level is at or below the global
17864  system error level.
17865  Description:
17866  This macro prints a debug message if the specified level is at or below the
17867  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17868  Precondition:
17869  SYS_DEBUG_Initialize must have returned a valid object handle.
17870  Parameters:
17871  level - The current error level threshold for displaying the message.
17872  message - Pointer to a buffer containing the message to be displayed.
17873  Returns:
17874  None.
17875  Example:
17876  <code>
17877  // In system_config.h
17878 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17879 
17880  // In library source (.c) code.
17881  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17882  </code>
17883  Remarks:
17884  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17885 
17886  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17887  function call from the source code. To access and utilize the message,
17888  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17889  SYS_DEBUG_MESSAGE macro.
17890 */
17891 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17892 // *****************************************************************************
17893 /* Macro:
17894  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17895  Summary:
17896  Formats and prints a debug message if the specified level is at or below the
17897  global system error level.
17898  Description:
17899  This function formats and prints a debug message if the specified level is
17900  at or below the global system error level. It can be used to implement the
17901  SYS_DEBUG_PRINT macro.
17902  Precondition:
17903  SYS_DEBUG_Initialize must have returned a valid object handle.
17904  Parameters:
17905  level - The current error level threshold for displaying the message.
17906  format - Pointer to a buffer containing the format string for
17907  the message to be displayed.
17908  ... - Zero or more optional parameters to be formated as
17909  defined by the format string.
17910  Returns:
17911  None.
17912  Example:
17913  <code>
17914  // In system_config.h
17915 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17916 
17917  // In source code
17918  int result;
17919 
17920  result = SomeOperation();
17921  if (result > MAX_VALUE)
17922  {
17923  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17924  // Take appropriate action
17925  }
17926  </code>
17927  Remarks:
17928  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17929 
17930  The default SYS_DEBUG_PRINT macro definition removes the message and
17931  function call from the source code. To access and utilize the message,
17932  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17933  SYS_DEBUG_PRINT macro.
17934 */
17935 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17936 // DOM-IGNORE-BEGIN
17937 // *****************************************************************************
17938 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17939  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17940  (system_config.h) will map the macros below to the appropriate system
17941  console functions.
17942 */
17943 // DOM-IGNORE-END
17944 // *****************************************************************************
17945 /* Macro:
17946  SYS_MESSAGE( const char* message )
17947  Summary:
17948  Prints a message to the console regardless of the system error level.
17949  Description:
17950  This macro is used to print a message to the console regardless of the
17951  system error level. It can be mapped to any desired implementation.
17952  Precondition:
17953  If mapped to the _SYS_MESSAGE function, then the system debug service must
17954  be initialized and running.
17955  Parameters:
17956  message - Pointer to a buffer containing the message string to be
17957  displayed.
17958  Returns:
17959  None.
17960  Example:
17961  <code>
17962  // In system_config.h:
17963 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17964 
17965  // In source (.c) files:
17966  SYS_MESSAGE("My Message\n\r");
17967  </code>
17968  Remarks:
17969  By default, this macro is defined as nothing, effectively removing all code
17970  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17971  defined in a way that maps calls to it to the desired implementation (see
17972  example, above).
17973 
17974  This macro can be mapped to the system console service (along with other
17975  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17976  configuration (system_config.h) instead of defining it individually.
17977 */
17978 #define SYS_MESSAGE( message )
17979 // *****************************************************************************
17980 /* Function:
17981  SYS_DEBUG_MESSAGE( const char* message )
17982  Summary:
17983  Prints a debug message if the system error level is defined defined at
17984  or lower than the level specified.
17985  Description:
17986  This function prints a debug message if the system error level is defined at
17987  or lower than the level specified.
17988  Precondition:
17989  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17990  Parameters:
17991  level - The current error level threshold for displaying the message.
17992  message - Pointer to a buffer containing the message to be displayed.
17993  Returns:
17994  None.
17995  Example:
17996  <code>
17997 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
17998  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
17999  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18000  </code>
18001  Remarks:
18002  By default, this macro is defined as nothing, effectively removing all code
18003  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18004  must be defined in a way that maps calls to it to the desired implementation
18005  (see example, above).
18006 
18007  This macro can be mapped to the system console service (along with other
18008  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18009  configuration (system_config.h) instead of defining it individually.
18010 */
18011 #define SYS_DEBUG_MESSAGE( level , message )
18012 // *****************************************************************************
18013 /* Function:
18014  SYS_PRINT(const char* format, ...);
18015  Summary:
18016  Formats and prints an error message with a variable number of arguments
18017  regardless of the system error level.
18018  Description:
18019  This function formats and prints an error message with a variable number of
18020  if the system error level is defined at or lower than the level specified.
18021  Precondition:
18022  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18023  Parameters:
18024  format - Pointer to a buffer containing the format string for
18025  the message to be displayed.
18026  ... - Zero or more optional parameters to be formated as
18027  defined by the format string.
18028  Returns:
18029  None.
18030  Example:
18031  <code>
18032  // In system_config.h
18033 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18034 
18035  // In source code
18036  int result;
18037 
18038  result = SomeOperation();
18039  if (result > MAX_VALUE)
18040  {
18041  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18042  // Take appropriate action
18043  }
18044  </code>
18045  Remarks:
18046  The format string and arguments follow the printf convention. This function
18047  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18048 
18049  By default, this macro is defined as nothing, effectively removing all code
18050  generated by calls to it. To process SYS_PRINT calls, this macro must be
18051  defined in a way that maps calls to it to the desired implementation (see
18052  example, above).
18053 
18054  This macro can be mapped to the system console service (along with other
18055  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18056  configuration (system_config.h) instead of defining it individually.
18057 */
18058 #define SYS_PRINT( fmt ,... )
18059 // *****************************************************************************
18060 /* Macro:
18061  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18062  Summary:
18063  Formats and prints an error message if the system error level is defined at
18064  or lower than the level specified.
18065  Description:
18066  This macro formats and prints an error message if the system error level
18067  is defined at or lower than the level specified.o
18068  Precondition:
18069  SYS_DEBUG_Initialize must have returned a valid object handle.
18070  Parameters:
18071  level - The current error level threshold for displaying the message.
18072  format - Pointer to a buffer containing the format string for
18073  the message to be displayed.
18074  ... - Zero or more optional parameters to be formated as
18075  defined by the format string.
18076  Returns:
18077  None.
18078  Example:
18079  <code>
18080  // In system_config.h
18081 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18082 
18083  // In source code
18084  int result;
18085 
18086  result = SomeOperation();
18087  if (result > MAX_VALUE)
18088  {
18089  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18090  // Take appropriate action
18091  }
18092  </code>
18093  Remarks:
18094  The format string and arguments follow the printf convention. This function
18095  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18096 
18097  By default, this macro is defined as nothing, effectively removing all code
18098  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18099  defined in a way that maps calls to it to the desired implementation (see
18100  example, above).
18101 
18102  This macro can be mapped to the system console service (along with other
18103  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18104  configuration (system_config.h) instead of defining it individually.
18105 */
18106 #define SYS_DEBUG_PRINT( level , fmt ,... )
18107 // *****************************************************************************
18108 /* Macro:
18109  SYS_DEBUG_BreakPoint( void )
18110  Summary:
18111  Inserts a software breakpoint instruction when building in Debug mode.
18112  Description:
18113  This macro inserts a software breakpoint instruction when building in Debug
18114  mode.
18115  Precondition:
18116  None.
18117  Parameters:
18118  None.
18119  Returns:
18120  None.
18121  Example:
18122  <code>
18123  if (myDebugTestFailed)
18124  {
18125  SYS_DEBUG_BreakPoint();
18126  }
18127  </code>
18128  Remarks:
18129  Compiles out if not built for debugging.
18130 */
18131 #define SYS_DEBUG_BreakPoint( )
18132 // *****************************************************************************
18133 // *****************************************************************************
18134 // Section: SYS DEBUG Deprecated Macros
18135 // *****************************************************************************
18136 // *****************************************************************************
18137 /* Do not use these macros for new development.
18138 */
18139 //DOM-IGNORE-BEGIN
18140 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18141 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18142 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18143 //DOM-IGNORE-END
18144  // _SYS_DEBUG_H
18145 /*******************************************************************************
18146  End of File
18147 */
18148 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18149 /* CLOSE_FILE Include File */
18150 
18151 // DOM-IGNORE-BEGIN
18152 // DOM-IGNORE-END
18153 // *****************************************************************************
18154 // *****************************************************************************
18155 // Section: Data Type Definitions
18156 // *****************************************************************************
18157 // *****************************************************************************
18158 /* USART FIFO+RX(8+1) size */
18159 #define _DRV_USART_RX_DEPTH 9
18160 // *****************************************************************************
18161 /* USART Static Driver Instance Object
18162  Summary:
18163  Object used to keep any data required for the static USART driver.
18164  Description:
18165  This object is used to keep track of any data that must be maintained to
18166  manage the USART static driver.
18167  Remarks:
18168  None.
18169 */
18170 
18171 typedef
18172  struct
18173  {
18174  /* Client specific error */
18175  DRV_USART_ERROR error ;
18176  } DRV_USART_OBJ ;
18177 // *****************************************************************************
18178 // *****************************************************************************
18179 // Section: Local functions.
18180 // *****************************************************************************
18181 // *****************************************************************************
18182 // DOM-IGNORE-BEGIN
18183 // DOM-IGNORE-END
18184  //#ifndef _DRV_USART_STATIC_LOCAL_H
18185 /*******************************************************************************
18186  End of File
18187 */
18188 
18189 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18190 /* CLOSE_FILE Include File */
18191 
18192 // DOM-IGNORE-BEGIN
18193 // DOM-IGNORE-END
18194 // *********************************************************************************************
18195 // *********************************************************************************************
18196 // Section: System Interface Headers for the Instance 0 of USART static driver
18197 // *********************************************************************************************
18198 // *********************************************************************************************
18199 
18200 SYS_MODULE_OBJ
18201  DRV_USART0_Initialize ( void ) ;
18202 
18203 void
18204  DRV_USART0_Deinitialize ( void ) ;
18205 
18206 SYS_STATUS
18207  DRV_USART0_Status ( void ) ;
18208 
18209 void
18210  DRV_USART0_TasksTransmit ( void ) ;
18211 
18212 void
18213  DRV_USART0_TasksReceive ( void ) ;
18214 
18215 void
18216  DRV_USART0_TasksError ( void ) ;
18217 // *********************************************************************************************
18218 // *********************************************************************************************
18219 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18220 // *********************************************************************************************
18221 // *********************************************************************************************
18222 
18223 DRV_HANDLE
18224  DRV_USART0_Open (
18225  const SYS_MODULE_INDEX index ,
18226  const DRV_IO_INTENT ioIntent ) ;
18227 
18228 void
18229  DRV_USART0_Close ( void ) ;
18230 
18232  DRV_USART0_ClientStatus ( void ) ;
18233 
18235  DRV_USART0_TransferStatus ( void ) ;
18236 
18238  DRV_USART0_ErrorGet ( void ) ;
18239 // *********************************************************************************************
18240 // *********************************************************************************************
18241 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18242 // *********************************************************************************************
18243 // *********************************************************************************************
18244 
18245 uint8_t
18246  DRV_USART0_ReadByte ( void ) ;
18247 
18248 void
18250  const uint8_t byte ) ;
18251 
18252 unsigned int
18254 
18255 unsigned int
18257 
18258 bool
18260 
18261 bool
18263 // *********************************************************************************************
18264 // *********************************************************************************************
18265 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18266 // *********************************************************************************************
18267 // *********************************************************************************************
18268 
18271  uint32_t baud ) ;
18272 
18275  DRV_USART_LINE_CONTROL lineControlMode ) ;
18276 // DOM-IGNORE-BEGIN
18277 // DOM-IGNORE-END
18278  // #ifndef _DRV_USART_STATIC_H
18279 /*******************************************************************************
18280  End of File
18281 */
18282 
18283 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18284 /* CLOSE_FILE Include File */
18285 
18286 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18287 /*******************************************************************************
18288  Ports System Service Interface Definition
18289  Company:
18290  Microchip Technology Inc.
18291  File Name:
18292  sys_ports.h
18293  Summary:
18294  Ports System Service interface definitions
18295  Description:
18296  This file contains the interface definition for the Ports system
18297  service. It provides a way to interact with the Ports subsystem to
18298  manage the timing requests supported by the system
18299 *******************************************************************************/
18300 //DOM-IGNORE-BEGIN
18301 /*******************************************************************************
18302 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18303 Microchip licenses to you the right to use, modify, copy and distribute
18304 Software only when embedded on a Microchip microcontroller or digital signal
18305 controller that is integrated into your product or third party product
18306 (pursuant to the sublicense terms in the accompanying license agreement).
18307 You should refer to the license agreement accompanying this Software for
18308 additional information regarding your rights and obligations.
18309 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18310 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18311 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18312 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18313 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18314 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18315 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18316 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18317 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18318 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18319 *******************************************************************************/
18320 //DOM-IGNORE-END
18321 #ifndef _SYS_PORTS_H
18322 #define _SYS_PORTS_H
18323 // *****************************************************************************
18324 // *****************************************************************************
18325 // Section: Included Files
18326 // *****************************************************************************
18327 // *****************************************************************************
18328 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18329 /*******************************************************************************
18330  PORTS System Service Library Interface Definition
18331  Company:
18332  Microchip Technology Inc.
18333  File Name:
18334  sys_ports_definitions.h
18335  Summary:
18336  PORTS System Service data type definitions header.
18337  Description:
18338  This file contains data type definitions header.
18339 *******************************************************************************/
18340 //DOM-IGNORE-BEGIN
18341 /*******************************************************************************
18342 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18343 Microchip licenses to you the right to use, modify, copy and distribute
18344 Software only when embedded on a Microchip microcontroller or digital signal
18345 controller that is integrated into your product or third party product
18346 (pursuant to the sublicense terms in the accompanying license agreement).
18347 You should refer to the license agreement accompanying this Software for
18348 additional information regarding your rights and obligations.
18349 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18350 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18351 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18352 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18353 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18354 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18355 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18356 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18357 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18358 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18359 *******************************************************************************/
18360 //DOM-IGNORE-END
18361 #ifndef _SYS_PORTS_DEFINITIONS_H
18362 #define _SYS_PORTS_DEFINITIONS_H
18363 // *****************************************************************************
18364 // *****************************************************************************
18365 // Section: File includes
18366 // *****************************************************************************
18367 // *****************************************************************************
18368 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18369 #include "system/common/sys_common.h"
18370 #include "system/common/sys_module.h"
18371 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18372 /*******************************************************************************
18373  Ports Peripheral Library Interface Header
18374  Company:
18375  Microchip Technology Inc.
18376  File Name:
18377  plib_ports.h
18378  Summary:
18379  Ports Peripheral Library Interface header for Ports function definitions.
18380  Description:
18381  This header file contains the function prototypes and definitions of
18382  the data types and constants that make up the interface to the Ports
18383  Peripheral Library for all families of Microchip microcontrollers. The
18384  definitions in this file are common to the Ports peripheral.
18385 *******************************************************************************/
18386 // DOM-IGNORE-BEGIN
18387 /*******************************************************************************
18388 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18389 Microchip licenses to you the right to use, modify, copy and distribute
18390 Software only when embedded on a Microchip microcontroller or digital signal
18391 controller that is integrated into your product or third party product
18392 (pursuant to the sublicense terms in the accompanying license agreement).
18393 You should refer to the license agreement accompanying this Software for
18394 additional information regarding your rights and obligations.
18395 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18396 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18397 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18398 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18399 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18400 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18401 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18402 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18403 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18404 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18405 *******************************************************************************/
18406 // DOM-IGNORE-END
18407 #ifndef _PLIB_PORTS_H
18408 #define _PLIB_PORTS_H
18409 #include <stdint.h>
18410 #include <stddef.h>
18411 // DOM-IGNORE-BEGIN
18412 // DOM-IGNORE-END
18413 // *****************************************************************************
18414 // *****************************************************************************
18415 // Section: Constants & Data Types
18416 // *****************************************************************************
18417 // *****************************************************************************
18418 // *****************************************************************************
18419 /* Ports data mask definition
18420  Summary:
18421  Data type defining the Ports data mask
18422  Description:
18423  This data type defines the Ports data mask
18424  Remarks:
18425  None.
18426 */
18427 
18428 typedef
18429 uint16_t
18431 // *****************************************************************************
18432 /* Ports data type definition
18433  Summary:
18434  Data type defining the Ports data type.
18435  Description:
18436  This data type defines the Ports data type.
18437  Remarks:
18438  None.
18439 */
18440 
18441 typedef
18442 uint32_t
18444 // *****************************************************************************
18445 // *****************************************************************************
18446 // Section: Included Files (continued at end of file)
18447 // *****************************************************************************
18448 // *****************************************************************************
18449 /* This section lists the other files that are included in this file. However,
18450  please see the end of the file for additional implementation header files
18451  that are also included.
18452 */
18453 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18454 //DOM-IGNORE-BEGIN
18455 /*******************************************************************************
18456 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18457 Microchip licenses to you the right to use, modify, copy and distribute
18458 Software only when embedded on a Microchip microcontroller or digital signal
18459 controller that is integrated into your product or third party product
18460 (pursuant to the sublicense terms in the accompanying license agreement).
18461 You should refer to the license agreement accompanying this Software for
18462 additional information regarding your rights and obligations.
18463 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18464 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18465 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18466 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18467 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18468 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18469 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18470 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18471 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18472 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18473  *******************************************************************************/
18474 //DOM-IGNORE-END
18475 #ifndef _PLIB_PORTS_PROCESSOR_H
18476 #define _PLIB_PORTS_PROCESSOR_H
18477 #error "Can't find header"
18478 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18479 /* CLOSE_FILE Include File */
18480 
18481 // *****************************************************************************
18482 // *****************************************************************************
18483 // Section: Ports Peripheral Library Interface Routines
18484 // *****************************************************************************
18485 // *****************************************************************************
18486 // *****************************************************************************
18487 /* Function:
18488  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18489  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18490  PORTS_REMAP_INPUT_PIN remapInputPin );
18491  Summary:
18492  Input function remapping.
18493  Description:
18494  This function controls the Input function remapping. It allows user to map
18495  any of the input functionality on any of the remappable input pin.
18496  This function does not perform atomic register access.
18497  Precondition:
18498  IOLOCK bit of configuration register should be clear to allow any remapping.
18499  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18500  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18501  find more information.
18502  Parameters:
18503  index - Identifier for the device instance to be configured
18504  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18505  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18506  Returns:
18507  None.
18508  Example:
18509  <code>
18510 
18511  // System Unlock
18512  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18513  // Unlock PPS registers
18514  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18515  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18516  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18517  </code>
18518  Remarks:
18519  This feature may not be available on all devices. Please refer to the
18520  specific device data sheet to determine availability or use
18521  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18522  this feature is available.
18523 */
18524 
18525 void
18527  PORTS_MODULE_ID index ,
18528  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18529  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18530 // *****************************************************************************
18531 /* Function:
18532  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18533  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18534  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18535  Summary:
18536  Output function remapping.
18537  Description:
18538  This function controls the Output function remapping. it allows user to map
18539  any of the output functionality on any of the remappable output pin.
18540  This function does not perform atomic register access.
18541  Precondition:
18542  IOLOCK bit of configuration register should be clear to allow any remapping.
18543  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18544  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18545  find more information.
18546  Parameters:
18547  index - Identifier for the device instance to be configured
18548  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18549  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18550  Returns:
18551  None.
18552  Example:
18553  <code>
18554 
18555  // System Unlock
18556  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18557  // Unlock PPS registers
18558  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18559  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18560  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18561 
18562  </code>
18563  Remarks:
18564  This feature may not be available on all devices. Please refer to the
18565  specific device data sheet to determine availability or use
18566  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18567  this feature is available.
18568 */
18569 
18570 void
18572  PORTS_MODULE_ID index ,
18573  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18574  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18575 // *****************************************************************************
18576 /* Function:
18577  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18578  PORTS_ANALOG_PIN pin,
18579  PORTS_PIN_MODE mode );
18580  Summary:
18581  Enables the selected pin as analog or digital.
18582  Description:
18583  This function enables the selected pin as analog or digital.
18584  This function does not perform atomic register access.
18585  Precondition:
18586  None.
18587  Parameters:
18588  index - Identifier for the device instance to be configured
18589  pin - Possible values of PORTS_ANALOG_PIN
18590  mode - Possible values of PORTS_PIN_MODE
18591  Returns:
18592  None.
18593  Example:
18594  <code>
18595 
18596  // Make AN0 pin as Analog
18597  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18598 
18599  </code>
18600  Remarks:
18601  This feature may not be available on all devices. Please refer to the
18602  specific device data sheet to determine availability or use
18603  PLIB_PORTS_ExistsPinMode in your application to determine whether
18604  this feature is available.
18605 */
18606 
18607 void
18609  PORTS_MODULE_ID index ,
18610  PORTS_ANALOG_PIN pin ,
18611  PORTS_PIN_MODE mode ) ;
18612 // *****************************************************************************
18613 /* Function:
18614  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18615  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18616  PORTS_PIN_MODE mode );
18617  Summary:
18618  Enables the selected port pin as analog or digital.
18619  Description:
18620  This function enables the selected port pin as analog or digital.
18621  This function does not perform atomic register access.
18622  Precondition:
18623  None.
18624  Parameters:
18625  index - Identifier for the device instance to be configured
18626  channel - Port pin channel
18627  bitPos - Position in the PORT pins
18628  mode - Possible values of PORTS_PIN_MODE
18629  Returns:
18630  None.
18631  Example:
18632  <code>
18633 
18634  // Make RC5 pin Analog
18635  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18636  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18637 
18638  </code>
18639  Remarks:
18640  This function is only available in devices with PPS. For Non-PPS devices, use the
18641  PLIB_PORTS_PinModeSelect function.
18642 
18643  This feature may not be available on all devices. Please refer to the
18644  specific device data sheet to determine availability or use
18645  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18646  this feature is available.
18647 */
18648 
18649 void
18651  PORTS_MODULE_ID index ,
18652  PORTS_CHANNEL channel ,
18653  PORTS_BIT_POS bitPos ,
18654  PORTS_PIN_MODE mode ) ;
18655 // *****************************************************************************
18656 /* Function:
18657  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18658  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18659  Summary:
18660  Enables the pull-down for selected Change Notice pins.
18661  Description:
18662  This function enables the pull-down for selected Change Notice pins.
18663  This function does not perform atomic register access.
18664  Precondition:
18665  None.
18666  Parameters:
18667  index - Identifier for the device instance to be configured
18668  channel - Port pin channel
18669  bitPos - Position in the PORT pins
18670  Returns:
18671  None.
18672  Example:
18673  <code>
18674 
18675  // Enable pull-down for RC5 pin
18676  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18677  PORTS_BIT_POS_5);
18678 
18679  </code>
18680  Remarks:
18681  This feature may not be available on all devices. Please refer to the
18682  specific device data sheet to determine availability or use
18683  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18684  determine whether this feature is available.
18685 */
18686 
18687 void
18689  PORTS_MODULE_ID index ,
18690  PORTS_CHANNEL channel ,
18691  PORTS_BIT_POS bitPos ) ;
18692 // *****************************************************************************
18693 /* Function:
18694  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18695  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18696  Summary:
18697  Disables the pull-down for selected Change Notice pins.
18698  Description:
18699  This function disables the pull-down for selected Change Notice pins.
18700  This function does not perform atomic register access.
18701  Precondition:
18702  None.
18703  Parameters:
18704  index - Identifier for the device instance to be configured
18705  channel - Port pin channel
18706  bitPos - Position in the PORT pins
18707  Returns:
18708  None.
18709  Example:
18710  <code>
18711 
18712  // Disable pull-down for RC5 pin
18713  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18714  PORTS_BIT_POS_5);
18715  </code>
18716  Remarks:
18717  This feature may not be available on all devices. Please refer to the
18718  specific device data sheet to determine availability or use
18719  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18720  determine whether this feature is available.
18721 */
18722 
18723 void
18725  PORTS_MODULE_ID index ,
18726  PORTS_CHANNEL channel ,
18727  PORTS_BIT_POS bitPos ) ;
18728 // *****************************************************************************
18729 /* Function:
18730  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18731  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18732  Summary:
18733  Enables the pull-up for selected Change Notice pins.
18734  Description:
18735  This function enables the pull-up for selected Change Notice pins.
18736  This function does not perform atomic register access.
18737  Precondition:
18738  None.
18739  Parameters:
18740  index - Identifier for the device instance to be configured
18741  channel - Port pin channel
18742  bitPos - Position in the PORT pins
18743  Returns:
18744  None.
18745  Example:
18746  <code>
18747 
18748  // Enable pull-up for RC5 pin
18749  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18750  PORTS_BIT_POS_5);
18751  </code>
18752  Remarks:
18753  This function is only available in devices with PPS. For Non-PPS devices, use the
18754  PLIB_PORTS_ChangeNoticePullUpEnable function.
18755 
18756  This feature may not be available on all devices. Please refer to the
18757  specific device data sheet to determine availability or use
18758  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18759  determine whether this feature is available.
18760 */
18761 
18762 void
18764  PORTS_MODULE_ID index ,
18765  PORTS_CHANNEL channel ,
18766  PORTS_BIT_POS bitPos ) ;
18767 // *****************************************************************************
18768 /* Function:
18769  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18770  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18771  Summary:
18772  Disables weak pull-up for the selected pin.
18773  Description:
18774  This function disables weak pull-up for the selected port pin.
18775  This function does not perform atomic register access.
18776  Precondition:
18777  None.
18778  Parameters:
18779  index - Identifier for the device instance to be configured
18780  channel - Port pin channel
18781  bitPos - Position in the PORT pins
18782  Returns:
18783  None.
18784  Example:
18785  <code>
18786 
18787  // Disable pull-up for RC5 pin
18788  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18789  PORTS_BIT_POS_5);
18790 
18791  </code>
18792  Remarks:
18793  This function is only available in devices with PPS. For Non-PPS devices, use the
18794  PLIB_PORTS_ChangeNoticePullUpDisable function.
18795 
18796  Pull-ups on change notification pins should always be disabled when the
18797  port pin is configured as a digital output.
18798 
18799  This feature may not be available on all devices. Please refer to the
18800  specific device data sheet to determine availability or use
18801  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18802  determine whether this feature is available.
18803 */
18804 
18805 void
18807  PORTS_MODULE_ID index ,
18808  PORTS_CHANNEL channel ,
18809  PORTS_BIT_POS bitPos ) ;
18810 // *****************************************************************************
18811 /* Function:
18812  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18813  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18814  Summary:
18815  Enables CN interrupt for the selected pin.
18816  Description:
18817  This function enables Change Notice interrupt for the selected port pin.
18818  This function does not perform atomic register access.
18819 
18820  Precondition:
18821  None.
18822  Parameters:
18823  index - Identifier for the device instance to be configured
18824  channel - Port pin channel
18825  bitPos - Position in the PORT pins
18826  Returns:
18827  None.
18828  Example:
18829  <code>
18830 
18831  // Enable CN interrupt for RC5 pin
18832  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18833  PORTS_BIT_POS_5);
18834 
18835  </code>
18836  Remarks:
18837  This function is only available in devices with PPS. For Non-PPS devices, use the
18838  PLIB_PORTS_PinChangeNoticeEnable function.
18839 
18840  This feature may not be available on all devices. Please refer to the
18841  specific device data sheet to determine availability or use
18842  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18843  determine whether this feature is available.
18844 */
18845 
18846 void
18848  PORTS_MODULE_ID index ,
18849  PORTS_CHANNEL channel ,
18850  PORTS_BIT_POS bitPos ) ;
18851 // *****************************************************************************
18852 /* Function:
18853  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18854  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18855  Summary:
18856  Disables CN interrupt for the selected pin.
18857  Description:
18858  This function disables Change Notice interrupt for the selected port pin.
18859  This function does not perform atomic register access.
18860  Precondition:
18861  None.
18862  Parameters:
18863  index - Identifier for the device instance to be configured
18864  channel - Port pin channel
18865  bitPos - Position in the PORT pins
18866  Returns:
18867  None.
18868  Example:
18869  <code>
18870 
18871  // Disable CN interrupt for RC5 pin
18872  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18873  PORTS_BIT_POS_5);
18874 
18875  </code>
18876  Remarks:
18877  This function is only available in devices with PPS. For Non-PPS devices, use the
18878  PLIB_PORTS_PinChangeNoticeDisable function.
18879 
18880  This feature may not be available on all devices. Please refer to the
18881  specific device data sheet to determine availability or use
18882  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18883  determine whether this feature is available.
18884 */
18885 
18886 void
18888  PORTS_MODULE_ID index ,
18889  PORTS_CHANNEL channel ,
18890  PORTS_BIT_POS bitPos ) ;
18891 // *****************************************************************************
18892 /* Function:
18893  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18894  PORTS_CHANNEL channel );
18895  Summary:
18896  Enables the change notification for selected port.
18897  Description:
18898  This function enables the change notification for selected port.
18899  This function does not perform atomic register access.
18900  Precondition:
18901  None.
18902  Parameters:
18903  index - Identifier for the device instance to be configured
18904  channel - Port pin channel
18905  Returns:
18906  None.
18907  Example:
18908  <code>
18909  // Enable Change notification for Port C
18910  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18911 
18912  </code>
18913  Remarks:
18914  This function is only available in devices with PPS. For Non-PPS devices, use the
18915  PLIB_PORTS_ChangeNoticeEnable function.
18916 
18917  This feature may not be available on all devices. Please refer to the
18918  specific device data sheet to determine availability or use
18919  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18920  whether this feature is available.
18921 */
18922 
18923 void
18925  PORTS_MODULE_ID index ,
18926  PORTS_CHANNEL channel ) ;
18927 // *****************************************************************************
18928 /* Function:
18929  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18930  PORTS_CHANNEL channel );
18931  Summary:
18932  Disables the change notification for selected port.
18933  Description:
18934  This function disables the change notification for selected port.
18935  This function does not perform atomic register access.
18936  Precondition:
18937  None.
18938  Parameters:
18939  index - Identifier for the device instance to be configured
18940  channel - Port pin channel
18941  Returns:
18942  None.
18943  Example:
18944  <code>
18945  // Disable Change notification for Port C
18946  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18947 
18948  </code>
18949  Remarks:
18950  This function is only available in devices with PPS. For Non-PPS devices, use the
18951  PLIB_PORTS_ChangeNoticeDisable function.
18952 
18953  This feature may not be available on all devices. Please refer to the
18954  specific device data sheet to determine availability or use
18955  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18956  whether this feature is available.
18957 */
18958 
18959 void
18961  PORTS_MODULE_ID index ,
18962  PORTS_CHANNEL channel ) ;
18963 // *****************************************************************************
18964 /* Function:
18965  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18966  PORTS_CHANNEL channel );
18967  Summary:
18968  Allows CN to be working in Idle mode for selected channel.
18969  Description:
18970  This function makes sure that change notification feature keeps working in
18971  Idle mode for the selected channel.
18972  This function does not perform atomic register access.
18973  Precondition:
18974  None.
18975  Parameters:
18976  index - Identifier for the device instance to be configured
18977  channel - Port pin channel
18978  Returns:
18979  None.
18980  Example:
18981  <code>
18982 
18983  // Change notification continues working in Idle mode for Port C
18984  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18985 
18986  </code>
18987  Remarks:
18988  This function is only available in devices with PPS. For Non-PPS devices, use the
18989  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18990 
18991  This feature may not be available on all devices. Please refer to the
18992  specific device data sheet to determine availability or use
18993  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18994  whether this feature is available.
18995 */
18996 
18997 void
18999  PORTS_MODULE_ID index ,
19000  PORTS_CHANNEL channel ) ;
19001 // *****************************************************************************
19002 /* Function:
19003  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19004  PORTS_CHANNEL channel );
19005  Summary:
19006  Change Notification halts in Idle mode for selected channel.
19007  Description:
19008  This function makes sure that change notification feature halts in
19009  Idle mode for the selected channel.
19010  This function does not perform atomic register access.
19011  Precondition:
19012  None.
19013  Parameters:
19014  index - Identifier for the device instance to be configured
19015  channel - Port pin channel
19016  Returns:
19017  None.
19018  Example:
19019  <code>
19020 
19021  // Change notification halts in Idle mode for Port C
19022  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19023 
19024  </code>
19025  Remarks:
19026  This function is only available in devices with PPS. For Non-PPS devices, use the
19027  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19028 
19029  This feature may not be available on all devices. Please refer to the
19030  specific device data sheet to determine availability or use
19031  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19032  whether this feature is available.
19033 */
19034 
19035 void
19037  PORTS_MODULE_ID index ,
19038  PORTS_CHANNEL channel ) ;
19039 // *****************************************************************************
19040 /* Function:
19041  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19042  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19043  Summary:
19044  checks the status of change on the pin
19045  Description:
19046  This function checks if the change has occurred on the given pin or not.
19047  This function does not perform atomic register access.
19048  Precondition:
19049  None.
19050  Parameters:
19051  index - Identifier for the device instance to be configured
19052  channel - Port pin channel
19053  bitPos - Position in the PORT pins
19054  Returns:
19055  None.
19056  Example:
19057  <code>
19058 
19059  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19060  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19061  {
19062  //do something
19063  }
19064 
19065  </code>
19066  Remarks:
19067  This feature may not be available on all devices. Please refer to the
19068  specific device data sheet to determine availability or use
19069  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19070  whether this feature is available.
19071 */
19072 
19073 bool
19075  PORTS_MODULE_ID index ,
19076  PORTS_CHANNEL channel ,
19077  PORTS_BIT_POS bitPos ) ;
19078 // *****************************************************************************
19079 /* Function:
19080  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19081  PORTS_BIT_POS bitPos )
19082  Summary:
19083  Reads/Gets data from the selected digital pin.
19084  Description:
19085  This function reads/gets data from the selected digital PORT i/o pin.
19086  This function should be used to read the live data at the pin.
19087  This function does not perform atomic register access.
19088 
19089  Precondition:
19090  None.
19091  Parameters:
19092  index - Identifier for the device instance to be configured
19093  channel - Identifier for the Ports channel A, B, C, etc.
19094  bitPos - Possible values of PORTS_BIT_POS
19095  Returns:
19096  Port pin read data.
19097  Example:
19098  <code>
19099  // read port pin RC4
19100  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19101  PORTS_BIT_POS_4);
19102  </code>
19103  Remarks:
19104  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19105 
19106  This feature may not be available on all devices. Please refer to the
19107  specific device data sheet to determine availability or use
19108  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19109  this feature is available.
19110 */
19111 
19112 bool
19114  PORTS_MODULE_ID index ,
19115  PORTS_CHANNEL channel ,
19116  PORTS_BIT_POS bitPos ) ;
19117 // *****************************************************************************
19118 /* Function:
19119  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19120  PORTS_BIT_POS bitPos )
19121  Summary:
19122  Reads/Gets data from the selected latch.
19123  Description:
19124  This function reads/gets data from the selected PORTx Data Latch, not from
19125  the port I/O pins.
19126  This function does not perform atomic register access.
19127 
19128  Precondition:
19129  None.
19130  Parameters:
19131  index - Identifier for the device instance to be configured
19132  channel - Identifier for the Ports channel A, B, C, etc.
19133  bitPos - Possible values of PORTS_BIT_POS
19134  Returns:
19135  Latch read data.
19136  Example:
19137  <code>
19138  // read latch RC4
19139  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19140  PORTS_BIT_POS_4);
19141  </code>
19142  Remarks:
19143  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19144  should be used.
19145 
19146  This feature may not be available on all devices. Please refer to the
19147  specific device data sheet to determine availability or use
19148  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19149  this feature is available.
19150 */
19151 
19152 bool
19154  PORTS_MODULE_ID index ,
19155  PORTS_CHANNEL channel ,
19156  PORTS_BIT_POS bitPos ) ;
19157 // *****************************************************************************
19158 /* Function:
19159  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19160  PORTS_BIT_POS bitPos,
19161  bool value )
19162  Summary:
19163  Writes the selected digital pin/latch.
19164  Description:
19165  This function writes to the selected digital pin/latch.
19166  This function does not perform atomic register access.
19167  Precondition:
19168  None.
19169  Parameters:
19170  index - Identifier for the device instance to be configured
19171  channel - Identifier for the Ports channel A, B, C, etc.
19172  bitPos - Possible values of PORTS_BIT_POS
19173  value - Value to be written to the specific pin/latch
19174  true - sets the bit, false - clears the bit
19175  Returns:
19176  None.
19177  Example:
19178  <code>
19179 
19180  // write 'one' in port RC4
19181  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19182 
19183  </code>
19184  Remarks:
19185  This feature may not be available on all devices. Please refer to the
19186  specific device data sheet to determine availability or use
19187  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19188  this feature is available.
19189 */
19190 
19191 void
19193  PORTS_MODULE_ID index ,
19194  PORTS_CHANNEL channel ,
19195  PORTS_BIT_POS bitPos ,
19196  bool value ) ;
19197 // *****************************************************************************
19198 /* Function:
19199  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19200  PORTS_BIT_POS bitPos )
19201  Summary:
19202  Sets the selected digital pin/latch.
19203  Description:
19204  This function sets the selected digital pin/latch.
19205  This function does not perform atomic register access.
19206  Precondition:
19207  None.
19208  Parameters:
19209  index - Identifier for the device instance to be configured
19210  channel - Identifier for the Ports channel A, B, C, etc.
19211  bitPos - Possible values of PORTS_BIT_POS
19212  Returns:
19213  None.
19214  Example:
19215  <code>
19216 
19217  // Sets port pin RC4
19218  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19219 
19220  </code>
19221  Remarks:
19222  This feature may not be available on all devices. Please refer to the
19223  specific device data sheet to determine availability or use
19224  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19225  this feature is available.
19226 */
19227 
19228 void
19230  PORTS_MODULE_ID index ,
19231  PORTS_CHANNEL channel ,
19232  PORTS_BIT_POS bitPos ) ;
19233 // *****************************************************************************
19234 /* Function:
19235  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19236  PORTS_BIT_POS bitPos )
19237  Summary:
19238  Clears the selected digital pin/latch.
19239  Description:
19240  This function clears the selected digital pin/latch.
19241  This function does not perform atomic register access.
19242  Precondition:
19243  None.
19244  Parameters:
19245  index - Identifier for the device instance to be configured
19246  channel - Identifier for the Ports channel A, B, C, etc.
19247  bitPos - Possible values of PORTS_BIT_POS
19248  Returns:
19249  None.
19250  Example:
19251  <code>
19252 
19253  // Clears port pin RC4
19254  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19255 
19256  </code>
19257  Remarks:
19258  This feature may not be available on all devices. Please refer to the
19259  specific device data sheet to determine availability or use
19260  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19261  this feature is available.
19262 */
19263 
19264 void
19266  PORTS_MODULE_ID index ,
19267  PORTS_CHANNEL channel ,
19268  PORTS_BIT_POS bitPos ) ;
19269 // *****************************************************************************
19270 /* Function:
19271  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19272  PORTS_BIT_POS bitPos )
19273  Summary:
19274  Toggles the selected digital pin/latch.
19275  Description:
19276  This function toggles the selected digital pin/latch.
19277  This function does not perform atomic register access.
19278  Precondition:
19279  None.
19280  Parameters:
19281  index - Identifier for the device instance to be configured
19282  channel - Identifier for the Ports channel A, B, C, etc.
19283  bitPos - Possible values of PORTS_BIT_POS
19284  Returns:
19285  None.
19286  Example:
19287  <code>
19288 
19289  // Toggles port pin RC4
19290  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19291 
19292  </code>
19293  Remarks:
19294  This feature may not be available on all devices. Please refer to the
19295  specific device data sheet to determine availability or use
19296  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19297  this feature is available.
19298 */
19299 
19300 void
19302  PORTS_MODULE_ID index ,
19303  PORTS_CHANNEL channel ,
19304  PORTS_BIT_POS bitPos ) ;
19305 // *****************************************************************************
19306 /* Function:
19307  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19308  PORTS_BIT_POS bitPos )
19309  Summary:
19310  Makes the selected pin direction input
19311  Description:
19312  This function makes the selected pin direction as input
19313  This function does not perform atomic register access.
19314  Precondition:
19315  None.
19316  Parameters:
19317  index - Identifier for the device instance to be configured
19318  channel - Identifier for the Ports channel A, B, C, etc.
19319  bitPos - Possible values of PORTS_BIT_POS direction that has to
19320  be made input
19321  Returns:
19322  None.
19323  Example:
19324  <code>
19325 
19326  // make pin RC4 as input
19327  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19328 
19329  </code>
19330  Remarks:
19331  This feature may not be available on all devices. Please refer to the
19332  specific device data sheet to determine availability or use
19333  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19334  this feature is available.
19335 */
19336 
19337 void
19339  PORTS_MODULE_ID index ,
19340  PORTS_CHANNEL channel ,
19341  PORTS_BIT_POS bitPos ) ;
19342 // *****************************************************************************
19343 /* Function:
19344  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19345  PORTS_BIT_POS bitPos )
19346  Summary:
19347  Makes the selected pin direction output
19348  Description:
19349  This function makes the selected pin direction as output
19350  This function does not perform atomic register access.
19351  Precondition:
19352  None.
19353  Parameters:
19354  index - Identifier for the device instance to be configured
19355  channel - Identifier for the Ports channel A, B, C, etc.
19356  bitPos - Possible values of PORTS_BIT_POS direction that has to
19357  be made output
19358  Returns:
19359  None.
19360  Example:
19361  <code>
19362 
19363  // make pin RC4 as output
19364  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19365 
19366  </code>
19367  Remarks:
19368  This feature may not be available on all devices. Please refer to the
19369  specific device data sheet to determine availability or use
19370  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19371  this feature is available.
19372 */
19373 
19374 void
19376  PORTS_MODULE_ID index ,
19377  PORTS_CHANNEL channel ,
19378  PORTS_BIT_POS bitPos ) ;
19379 // *****************************************************************************
19380 /* Function:
19381  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19382  PORTS_BIT_POS bitPos )
19383  Summary:
19384  Enables the open drain functionality for the selected pin.
19385  Description:
19386  This function enables the open drain functionality for the selected pin.
19387  This function does not perform atomic register access.
19388  Precondition:
19389  None.
19390  Parameters:
19391  index - Identifier for the device instance to be configured
19392  channel - Identifier for the Ports channel A, B, C, etc.
19393  bitPos - Possible values of PORTS_BIT_POS
19394  Returns:
19395  None.
19396  Example:
19397  <code>
19398 
19399  // Enable open drain for pin RC4
19400  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19401 
19402  </code>
19403  Remarks:
19404  This feature may not be available on all devices. Please refer to the
19405  specific device data sheet to determine availability or use
19406  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19407  this feature is available.
19408 */
19409 
19410 void
19412  PORTS_MODULE_ID index ,
19413  PORTS_CHANNEL channel ,
19414  PORTS_BIT_POS bitPos ) ;
19415 // *****************************************************************************
19416 /* Function:
19417  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19418  PORTS_BIT_POS bitPos )
19419  Summary:
19420  Disables the open drain functionality for the selected pin.
19421  Description:
19422  This function disables the open drain functionality for the selected pin.
19423  This function does not perform atomic register access.
19424  Precondition:
19425  None.
19426  Parameters:
19427  index - Identifier for the device instance to be configured
19428  channel - Identifier for the Ports channel A, B, C, etc.
19429  bitPos - One of the possible values of PORTS_BIT_POS.
19430  Returns:
19431  None.
19432  Example:
19433  <code>
19434 
19435  // Disable open drain for pin RC4
19436  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19437 
19438  </code>
19439  Remarks:
19440  This feature may not be available on all devices. Please refer to the
19441  specific device data sheet to determine availability or use
19442  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19443  this feature is available.
19444 */
19445 
19446 void
19448  PORTS_MODULE_ID index ,
19449  PORTS_CHANNEL channel ,
19450  PORTS_BIT_POS bitPos ) ;
19451 // *****************************************************************************
19452 /* Function:
19453  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19454  (
19455  PORTS_MODULE_ID index,
19456  PORTS_CHANNEL channel
19457  )
19458  Summary:
19459  Reads and returns data from the selected Latch.
19460  Description:
19461  This function reads and returns the data from the selected Latch.
19462  This function does not perform atomic register access.
19463 
19464  Precondition:
19465  None.
19466  Parameters:
19467  index - Identifier for the device instance to be configured
19468  channel - Identifier for the Ports channel A, B, C, etc.
19469  Returns:
19470  Latch read data.
19471  Example:
19472  <code>
19473  // Read latch C
19474  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19475 
19476  </code>
19477  Remarks:
19478  For reading the Live data, PLIB_PORTS_Read function should be used.
19479 
19480  This feature may not be available on all devices. Please refer to the
19481  specific device data sheet to determine availability or use
19482  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19483  this feature is available.
19484 */
19485 
19488  PORTS_MODULE_ID index ,
19489  PORTS_CHANNEL channel ) ;
19490 // *****************************************************************************
19491 /* Function:
19492  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19493  Summary:
19494  Reads the selected digital port.
19495  Description:
19496  This function reads from the selected digital port.
19497  This function does not perform atomic register access.
19498  Precondition:
19499  None.
19500  Parameters:
19501  index - Identifier for the device instance to be configured
19502  channel - Identifier for the Ports channel A, B, C, etc.
19503  Returns:
19504  data on a port with width PORTS_DATA_TYPE
19505  Example:
19506  <code>
19507 
19508  // Read PORT C
19509  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19510 
19511  </code>
19512  Remarks:
19513  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19514 
19515  This feature may not be available on all devices. Please refer to the
19516  specific device data sheet to determine availability or use
19517  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19518  this feature is available.
19519 */
19520 
19522  PLIB_PORTS_Read (
19523  PORTS_MODULE_ID index ,
19524  PORTS_CHANNEL channel ) ;
19525 // *****************************************************************************
19526 /* Function:
19527  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19528  PORTS_DATA_TYPE value )
19529  Summary:
19530  Writes the selected digital port/latch.
19531  Description:
19532  This function writes to the selected digital port/latch.
19533  This function does not perform atomic register access.
19534  Precondition:
19535  None.
19536  Parameters:
19537  index - Identifier for the device instance to be configured
19538  channel - Identifier for the Ports channel A, B, C, etc.
19539  value - Value to be written into a port of width PORTS_DATA_TYPE
19540  Returns:
19541  None.
19542  Example:
19543  <code>
19544 
19545  // Write 0x12 into PORT C
19546  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19547 
19548  </code>
19549  Remarks:
19550  This feature may not be available on all devices. Please refer to the
19551  specific device data sheet to determine availability or use
19552  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19553  this feature is available.
19554 */
19555 
19556 void
19558  PORTS_MODULE_ID index ,
19559  PORTS_CHANNEL channel ,
19560  PORTS_DATA_TYPE value ) ;
19561 // *****************************************************************************
19562 /* Function:
19563  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19564  PORTS_DATA_TYPE value,
19565  PORTS_DATA_MASK mask )
19566  Summary:
19567  Sets the selected bits of the port.
19568  Description:
19569  This function performs an 'AND' operation on the value and mask parameters,
19570  and then sets the bits in the port channel that were set by the result of the
19571  'AND' operation.
19572  This function does not perform atomic register access.
19573  Precondition:
19574  None.
19575  Parameters:
19576  index - Identifier for the device instance to be configured
19577  channel - Identifier for the Ports channel A, B, C, etc.
19578  value - Consists of information about which port bit has to be
19579  set and which not
19580  mask - Identifies the bits which could be intended for setting
19581  Returns:
19582  None.
19583  Example:
19584  <code>
19585 
19586  // MY_VALUE - 0x1234
19587  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19588 
19589  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19590  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19591 
19592  </code>
19593  Remarks:
19594  This feature may not be available on all devices. Please refer to the
19595  specific device data sheet to determine availability or use
19596  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19597  this feature is available.
19598 */
19599 
19600 void
19601  PLIB_PORTS_Set (
19602  PORTS_MODULE_ID index ,
19603  PORTS_CHANNEL channel ,
19604  PORTS_DATA_TYPE value ,
19605  PORTS_DATA_MASK mask ) ;
19606 // *****************************************************************************
19607 /* Function:
19608  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19609  PORTS_DATA_MASK toggleMask )
19610  Summary:
19611  Toggles the selected digital port/latch.
19612  Description:
19613  This function toggles the selected digital port/latch.
19614  This function does not perform atomic register access.
19615  Precondition:
19616  None.
19617  Parameters:
19618  index - Identifier for the device instance to be configured
19619  channel - Identifier for the Ports channel A, B, C, etc.
19620  toggleMask - Identifies the bits to be toggled
19621  Returns:
19622  None.
19623  Example:
19624  <code>
19625 
19626  // Toggles the three least significant Port C bits
19627  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19628 
19629  </code>
19630  Remarks:
19631  This feature may not be available on all devices. Please refer to the
19632  specific device data sheet to determine availability or use
19633  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19634  this feature is available.
19635 */
19636 
19637 void
19639  PORTS_MODULE_ID index ,
19640  PORTS_CHANNEL channel ,
19641  PORTS_DATA_MASK toggleMask ) ;
19642 // *****************************************************************************
19643 /* Function:
19644  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19645  PORTS_DATA_MASK clearMask )
19646  Summary:
19647  Clears the selected digital port/latch bits.
19648  Description:
19649  This function clears the selected digital port/latch bits.
19650  This function does not perform atomic register access.
19651  Precondition:
19652  None.
19653  Parameters:
19654  index - Identifier for the device instance to be configured
19655  channel - Identifier for the Ports channel A, B, C, etc.
19656  clearMask - Identifies the bits to be cleared
19657  Returns:
19658  None.
19659  Example:
19660  <code>
19661 
19662  // Clears the three least significant Port C bits
19663  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19664 
19665  </code>
19666  Remarks:
19667  This feature may not be available on all devices. Please refer to the
19668  specific device data sheet to determine availability or use
19669  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19670  this feature is available.
19671 */
19672 
19673 void
19675  PORTS_MODULE_ID index ,
19676  PORTS_CHANNEL channel ,
19677  PORTS_DATA_MASK clearMask ) ;
19678 // *****************************************************************************
19679 /* Function:
19680  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19681  PORTS_DATA_MASK mask )
19682  Summary:
19683  Makes the selected pins direction input.
19684  Description:
19685  This function makes the selected pins direction input.
19686  This function does not perform atomic register access.
19687 
19688  Precondition:
19689  None.
19690  Parameters:
19691  index - Identifier for the device instance to be configured
19692  channel - Identifier for the Ports channel A, B, C, etc.
19693  mask - Identifies the pins direction that has to be made input
19694  Returns:
19695  None.
19696  Example:
19697  <code>
19698 
19699  // Make RC0, RC1 and RC2 pins as Input
19700  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19701 
19702  </code>
19703  Remarks:
19704  This feature may not be available on all devices. Please refer to the
19705  specific device data sheet to determine availability or use
19706  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19707  this feature is available.
19708 */
19709 
19710 void
19712  PORTS_MODULE_ID index ,
19713  PORTS_CHANNEL channel ,
19714  PORTS_DATA_MASK mask ) ;
19715 // *****************************************************************************
19716 /* Function:
19717  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19718  PORTS_DATA_MASK mask )
19719  Summary:
19720  Makes the selected pins direction output.
19721  Description:
19722  This function makes the selected pins direction output.
19723  This function does not perform atomic register access.
19724  Precondition:
19725  None.
19726  Parameters:
19727  index - Identifier for the device instance to be configured
19728  channel - Identifier for the Ports channel A, B, C, etc.
19729  mask - Identifies the pins direction that has to be made output
19730  Returns:
19731  None.
19732  Example:
19733  <code>
19734 
19735  // Make RC0, RC1 and RC2 pins as Output
19736  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19737 
19738  </code>
19739  Remarks:
19740  This feature may not be available on all devices. Please refer to the
19741  specific device data sheet to determine availability or use
19742  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19743  this feature is available.
19744 */
19745 
19746 void
19748  PORTS_MODULE_ID index ,
19749  PORTS_CHANNEL channel ,
19750  PORTS_DATA_MASK mask ) ;
19751 // *****************************************************************************
19752 /* Function:
19753  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19754  Summary:
19755  Reads the direction of the selected digital port.
19756  Description:
19757  This function reads the direction of the selected digital port.
19758  This function does not perform atomic register access.
19759  Precondition:
19760  None.
19761  Parameters:
19762  index - Identifier for the device instance to be configured
19763  channel - Identifier for the Ports channel A, B, C, etc.
19764  Returns:
19765  Direction of the selected port of type PORTS_DATA_MASK
19766  Example:
19767  <code>
19768 
19769  // Reads the direction of Port C pins
19770  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19771 
19772  </code>
19773  Remarks:
19774  This feature may not be available on all devices. Please refer to the
19775  specific device data sheet to determine availability or use
19776  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19777  this feature is available.
19778 */
19779 
19782  PORTS_MODULE_ID index ,
19783  PORTS_CHANNEL channel ) ;
19784 // *****************************************************************************
19785 /* Function:
19786  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19787  PORTS_DATA_MASK mask )
19788  Summary:
19789  Enables the open drain functionality for the selected port pins.
19790  Description:
19791  This function enables the open drain functionality for the selected port pins.
19792  This function does not perform atomic register access.
19793  Precondition:
19794  None.
19795  Parameters:
19796  index - Identifier for the device instance to be configured
19797  channel - Identifier for the Ports channel A, B, C, etc.
19798  mask - Identifies the pins for the open drain to be enabled
19799  Returns:
19800  None.
19801  Example:
19802  <code>
19803 
19804  // Enable Open Drain for RC0, RC1 and RC2 pins
19805  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19806 
19807  </code>
19808  Remarks:
19809  This feature may not be available on all devices. Please refer to the
19810  specific device data sheet to determine availability or use
19811  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19812  this feature is available.
19813 */
19814 
19815 void
19817  PORTS_MODULE_ID index ,
19818  PORTS_CHANNEL channel ,
19819  PORTS_DATA_MASK mask ) ;
19820 // *****************************************************************************
19821 /* Function:
19822  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19823  PORTS_DATA_MASK mask )
19824  Summary:
19825  Disables the open drain functionality for the selected port.
19826  Description:
19827  This function disables the open drain functionality for the selected port.
19828  This function does not perform atomic register access.
19829 
19830  Precondition:
19831  None.
19832  Parameters:
19833  index - Identifier for the device instance to be configured
19834  channel - Identifier for the Ports channel A, B, C, etc.
19835  mask - Identifies the pins for the open drain to be disabled
19836  Returns:
19837  None.
19838  Example:
19839  <code>
19840 
19841  // Disable Open Drain for RC0, RC1 and RC2 pins
19842  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19843 
19844  </code>
19845  Remarks:
19846  This feature may not be available on all devices. Please refer to the
19847  specific device data sheet to determine availability or use
19848  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19849  this feature is available.
19850 */
19851 
19852 void
19854  PORTS_MODULE_ID index ,
19855  PORTS_CHANNEL channel ,
19856  PORTS_DATA_MASK mask ) ;
19857 // *****************************************************************************
19858 /* Function:
19859  void PLIB_PORTS_ChannelModeSelect
19860  (
19861  PORTS_MODULE_ID index,
19862  PORTS_CHANNEL channel,
19863  PORTS_DATA_MASK modeMask,
19864  PORTS_PIN_MODE mode
19865  );
19866  Summary:
19867  Enables the selected channel pins as analog or digital.
19868  Description:
19869  This function enables the selected channel pins as analog or digital.
19870  This function does not perform atomic register access.
19871  Precondition:
19872  None.
19873  Parameters:
19874  index - Identifier for the device instance to be configured
19875  channel - Port pin channel
19876  modeMask - Identifies the pins whose mode has to be modified.
19877  Modes of the pins whose corresponding bit is '1' get
19878  modified, mode of the other pins remains the same.
19879  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19880  Returns:
19881  None.
19882  Example:
19883  <code>
19884 
19885  // Make pins RC5, RC8 and RC13 Analog
19886  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19887 
19888  </code>
19889  Remarks:
19890  This function is only available in devices with PPS. For Non-PPS devices, use the
19891  PLIB_PORTS_AnPinsModeSelect function.
19892 
19893  This feature may not be available on all devices. Please refer to the
19894  specific device data sheet to determine availability or use
19895  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19896  this feature is available.
19897 */
19898 
19899 void
19901  PORTS_MODULE_ID index ,
19902  PORTS_CHANNEL channel ,
19903  PORTS_DATA_MASK modeMask ,
19904  PORTS_PIN_MODE mode ) ;
19905 // *****************************************************************************
19906 /* Function:
19907  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19908  (
19909  PORTS_MODULE_ID index,
19910  PORTS_CHANNEL channel,
19911  PORTS_DATA_MASK mask
19912  );
19913  Summary:
19914  Enables Change Notice pull-up for the selected channel pins.
19915  Description:
19916  This function enables the Change Notice pull-up for the selected
19917  channel pins.
19918  This function does not perform atomic register access.
19919  Precondition:
19920  None.
19921  Parameters:
19922  index - Identifier for the device instance to be configured
19923  channel - Port pin channel
19924  mask - Identifies the pins of the pull-up to be enabled
19925  Returns:
19926  None.
19927  Example:
19928  <code>
19929 
19930  // Enable pull-up for RC5, RC8 and RC13 pins
19931  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19932  0x2120);
19933  </code>
19934  Remarks:
19935  This function is only available in devices with PPS. For Non-PPS devices, use the
19936  PLIB_PORTS_CnPinsPullUpEnable function.
19937 
19938  This feature may not be available on all devices. Please refer to the
19939  specific device data sheet to determine availability or use
19940  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19941  determine whether this feature is available.
19942 */
19943 
19944 void
19946  PORTS_MODULE_ID index ,
19947  PORTS_CHANNEL channel ,
19948  PORTS_DATA_MASK mask ) ;
19949 // *****************************************************************************
19950 /* Function:
19951  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19952  (
19953  PORTS_MODULE_ID index,
19954  PORTS_CHANNEL channel,
19955  PORTS_DATA_MASK mask
19956  );
19957  Summary:
19958  Disables Change Notice pull-up for the selected channel pins.
19959  Description:
19960  This function Disables the Change Notice pull-up for the selected
19961  channel pins.
19962  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19963  Precondition:
19964  None.
19965  Parameters:
19966  index - Identifier for the device instance to be configured
19967  channel - Port pin channel
19968  mask - Identifies the pins of the pull-up to be disabled
19969  Returns:
19970  None.
19971  Example:
19972  <code>
19973 
19974  // Disable pull-up for RC5, RC8 and RC13 pins
19975  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19976  0x2120);
19977  </code>
19978  Remarks:
19979  This function is only available in devices with PPS. For Non-PPS devices, use the
19980  PLIB_PORTS_CnPinsPullUpDisable function.
19981 
19982  This feature may not be available on all devices. Please refer to the
19983  specific device data sheet to determine availability or use
19984  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19985  determine whether this feature is available.
19986 */
19987 
19988 void
19990  PORTS_MODULE_ID index ,
19991  PORTS_CHANNEL channel ,
19992  PORTS_DATA_MASK mask ) ;
19993 // *****************************************************************************
19994 /* Function:
19995  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
19996  (
19997  PORTS_MODULE_ID index,
19998  PORTS_CHANNEL channel,
19999  PORTS_DATA_MASK mask
20000  );
20001  Summary:
20002  Enables Change Notice pull-down for the selected channel pins.
20003  Description:
20004  This function enables the Change Notice pull-down for the selected
20005  channel pins.
20006  This function does not perform atomic register access.
20007  Precondition:
20008  None.
20009  Parameters:
20010  index - Identifier for the device instance to be configured
20011  channel - Port pin channel
20012  mask - Identifies the pins for the pull-down to be enabled
20013  Returns:
20014  None.
20015  Example:
20016  <code>
20017 
20018  // Enable pull-down for RC5, RC8 and RC13 pins
20019  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20020  0x2120);
20021  </code>
20022  Remarks:
20023  This feature may not be available on all devices. Please refer to the
20024  specific device data sheet to determine availability or use
20025  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20026  determine whether this feature is available.
20027 */
20028 
20029 void
20031  PORTS_MODULE_ID index ,
20032  PORTS_CHANNEL channel ,
20033  PORTS_DATA_MASK mask ) ;
20034 // *****************************************************************************
20035 /* Function:
20036  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20037  (
20038  PORTS_MODULE_ID index,
20039  PORTS_CHANNEL channel,
20040  PORTS_DATA_MASK mask
20041  );
20042  Summary:
20043  Disables Change Notice pull-down for the selected channel pins.
20044  Description:
20045  This function Disables the Change Notice pull-down for the selected
20046  channel pins.
20047  This function does not perform atomic register access.
20048  Precondition:
20049  None.
20050  Parameters:
20051  index - Identifier for the device instance to be configured
20052  channel - Port pin channel
20053  mask - Identifies the pins for the pull-down to be disabled
20054  Returns:
20055  None.
20056  Example:
20057  <code>
20058 
20059  // Disable pull-down for RC5, RC8 and RC13 pins
20060  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20061  0x2120);
20062  </code>
20063  Remarks:
20064  This feature may not be available on all devices. Please refer to the
20065  specific device data sheet to determine availability or use
20066  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20067  determine whether this feature is available.
20068 */
20069 
20070 void
20072  PORTS_MODULE_ID index ,
20073  PORTS_CHANNEL channel ,
20074  PORTS_DATA_MASK mask ) ;
20075 // *****************************************************************************
20076 /* Function:
20077  void PLIB_PORTS_ChannelChangeNoticeEnable
20078  (
20079  PORTS_MODULE_ID index,
20080  PORTS_CHANNEL channel,
20081  PORTS_DATA_MASK mask
20082  );
20083  Summary:
20084  Enables CN interrupt for the selected pins of a channel.
20085  Description:
20086  This function enables Change Notice interrupt for the selected port
20087  pins of a channel.
20088  This function does not perform atomic register access.
20089  Precondition:
20090  None.
20091  Parameters:
20092  index - Identifier for the device instance to be configured
20093  channel - Port pin channel
20094  mask - Identifies the pins for which change notification is
20095  to be enabled
20096  Returns:
20097  None.
20098  Example:
20099  <code>
20100 
20101  // Enable CN interrupt for RC5, RC8 and RC13 pins
20102  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20103 
20104  </code>
20105  Remarks:
20106  This function is only available in devices with PPS. For Non-PPS devices, use the
20107  PLIB_PORTS_CnPinsEnable function.
20108 
20109  This feature may not be available on all devices. Please refer to the
20110  specific device data sheet to determine availability or use
20111  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20112  determine whether this feature is available.
20113 */
20114 
20115 void
20117  PORTS_MODULE_ID index ,
20118  PORTS_CHANNEL channel ,
20119  PORTS_DATA_MASK mask ) ;
20120 // *****************************************************************************
20121 /* Function:
20122  void PLIB_PORTS_ChannelChangeNoticeDisable
20123  (
20124  PORTS_MODULE_ID index,
20125  PORTS_CHANNEL channel,
20126  PORTS_DATA_MASK mask
20127  );
20128  Summary:
20129  Disables CN interrupt for the selected pins of a channel.
20130  Description:
20131  This function Disables Change Notice interrupt for the selected port
20132  pins of a channel.
20133  This function does not perform atomic register access.
20134  Precondition:
20135  None.
20136  Parameters:
20137  index - Identifier for the device instance to be configured
20138  channel - Port pin channel
20139  mask - Identifies the pins for which change notification is
20140  to be disabled
20141  Returns:
20142  None.
20143  Example:
20144  <code>
20145 
20146  // Disable CN interrupt for RC5, RC8 and RC13 pins
20147  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20148 
20149  </code>
20150  Remarks:
20151  This function is only available in devices with PPS. For Non-PPS devices, use the
20152  PLIB_PORTS_CnPinsDisable function.
20153 
20154  This feature may not be available on all devices. Please refer to the
20155  specific device data sheet to determine availability or use
20156  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20157  determine whether this feature is available.
20158 */
20159 
20160 void
20162  PORTS_MODULE_ID index ,
20163  PORTS_CHANNEL channel ,
20164  PORTS_DATA_MASK mask ) ;
20165 // *****************************************************************************
20166 /* Function:
20167  void PLIB_PORTS_AnPinsModeSelect
20168  (
20169  PORTS_MODULE_ID index,
20170  PORTS_AN_PIN anPins,
20171  PORTS_PIN_MODE mode
20172  );
20173  Summary:
20174  Enables the selected AN pins as analog or digital.
20175  Description:
20176  This function enables the selected AN pins as analog or digital.
20177  This function does not perform atomic register access.
20178  Precondition:
20179  None.
20180  Parameters:
20181  index - Identifier for the device instance to be configured
20182  anPins - AN pins whose mode is to be changed. Multiple AN pins
20183  can be ORed.
20184  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20185  Returns:
20186  None.
20187  Example:
20188  <code>
20189 
20190  // Make pins AN5, AN8 and AN13 Analog
20191  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20192  PORTS_AN_PIN_8 |
20193  PORTS_AN_PIN_13,
20194  PORTS_PIN_MODE_ANALOG);
20195 
20196  </code>
20197  Remarks:
20198  This function is only available in devices without PPS feature. For PPS
20199  devices, use the PLIB_PORTS_ChannelModeSelect function.
20200 
20201  This feature may not be available on all devices. Please refer to the
20202  specific device data sheet to determine availability or use
20203  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20204  this feature is available.
20205 */
20206 
20207 void
20209  PORTS_MODULE_ID index ,
20210  PORTS_AN_PIN anPins ,
20211  PORTS_PIN_MODE mode ) ;
20212 // *****************************************************************************
20213 /* Function:
20214  void PLIB_PORTS_CnPinsPullUpEnable
20215  (
20216  PORTS_MODULE_ID index,
20217  PORTS_CN_PIN cnPins
20218  );
20219  Summary:
20220  Enables Change Notice pull-up for the selected channel pins.
20221  Description:
20222  This function enables the Change Notice pull-up for the selected
20223  channel pins.
20224  This function performs atomic register access.
20225  Precondition:
20226  None.
20227  Parameters:
20228  index - Identifier for the device instance to be configured
20229  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20230  can be ORed.
20231  Returns:
20232  None.
20233  Example:
20234  <code>
20235 
20236  // Enable pull-up for CN5, CN8 and CN13 pins
20237  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20238  CHANGE_NOTICE_PIN_8 |
20239  CHANGE_NOTICE_PIN_13);
20240 
20241  </code>
20242  Remarks:
20243  This function is only available in devices without PPS feature. For PPS
20244  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20245 
20246  This feature may not be available on all devices. Please refer to the
20247  specific device data sheet to determine availability or use
20248  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20249  determine whether this feature is available.
20250 */
20251 
20252 void
20254  PORTS_MODULE_ID index ,
20255  PORTS_CN_PIN cnPins ) ;
20256 // *****************************************************************************
20257 /* Function:
20258  void PLIB_PORTS_CnPinsPullUpDisable
20259  (
20260  PORTS_MODULE_ID index,
20261  PORTS_CN_PIN cnPins
20262  );
20263  Summary:
20264  Disables Change Notice pull-up for the selected channel pins.
20265  Description:
20266  This function Disables the Change Notice pull-up for the selected
20267  channel pins.
20268  This function performs atomic register access.
20269  Precondition:
20270  None.
20271  Parameters:
20272  index - Identifier for the device instance to be configured
20273  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20274  can be ORed.
20275  Returns:
20276  None.
20277  Example:
20278  <code>
20279 
20280  // Disable pull-up for CN5, CN8 and CN13 pins
20281  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20282  CHANGE_NOTICE_PIN_5 |
20283  CHANGE_NOTICE_PIN_8 |
20284  CHANGE_NOTICE_PIN_13);
20285 
20286  </code>
20287  Remarks:
20288  This function is only available in devices without PPS feature. For PPS
20289  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20290 
20291  This feature may not be available on all devices. Please refer to the
20292  specific device data sheet to determine availability or use
20293  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20294  determine whether this feature is available.
20295 */
20296 
20297 void
20299  PORTS_MODULE_ID index ,
20300  PORTS_CN_PIN cnPins ) ;
20301 // *****************************************************************************
20302 /* Function:
20303  void PLIB_PORTS_CnPinsEnable
20304  (
20305  PORTS_MODULE_ID index,
20306  PORTS_CN_PIN cnPins
20307  );
20308  Summary:
20309  Enables CN interrupt for the selected pins of a channel.
20310  Description:
20311  This function enables Change Notice interrupt for the selected port
20312  pins of a channel.
20313  This function performs atomic register access.
20314  Precondition:
20315  None.
20316  Parameters:
20317  index - Identifier for the device instance to be configured
20318  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20319  Returns:
20320  None.
20321  Example:
20322  <code>
20323 
20324  // Enable CN interrupt for CN5, CN8 and CN13 pins
20325  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20326  CHANGE_NOTICE_PIN_5 |
20327  CHANGE_NOTICE_PIN_8 |
20328  CHANGE_NOTICE_PIN_13);
20329 
20330  </code>
20331  Remarks:
20332  This function is only available in devices without PPS feature. For PPS
20333  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20334 
20335  This feature may not be available on all devices. Please refer to the
20336  specific device data sheet to determine availability or use
20337  PLIB_PORTS_ExistsPinChangeNotice in your application to
20338  determine whether this feature is available.
20339 */
20340 
20341 void
20343  PORTS_MODULE_ID index ,
20344  PORTS_CN_PIN cnPins ) ;
20345 // *****************************************************************************
20346 /* Function:
20347  void PLIB_PORTS_CnPinsDisable
20348  (
20349  PORTS_MODULE_ID index,
20350  PORTS_CN_PIN cnPins
20351  );
20352  Summary:
20353  Disables CN interrupt for the selected pins of a channel.
20354  Description:
20355  This function Disables Change Notice interrupt for the selected port
20356  pins of a channel.
20357  This function performs atomic register access.
20358  Precondition:
20359  None.
20360  Parameters:
20361  index - Identifier for the device instance to be configured
20362  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20363  Returns:
20364  None.
20365  Example:
20366  <code>
20367 
20368  // Disable CN interrupt for CN5, CN8 and CN13 pins
20369  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20370  CHANGE_NOTICE_PIN_5 |
20371  CHANGE_NOTICE_PIN_8 |
20372  CHANGE_NOTICE_PIN_13);
20373 
20374  </code>
20375  Remarks:
20376  This function is only available in devices without PPS feature. For PPS
20377  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20378 
20379  This feature may not be available on all devices. Please refer to the
20380  specific device data sheet to determine availability or use
20381  PLIB_PORTS_ExistsPinChangeNotice in your application to
20382  determine whether this feature is available.
20383 */
20384 
20385 void
20387  PORTS_MODULE_ID index ,
20388  PORTS_CN_PIN cnPins ) ;
20389 // *****************************************************************************
20390 /* Function:
20391  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20392  Summary:
20393  Global Change Notice enable.
20394  Description:
20395  This function enables the global Change Notice feature.
20396  This function performs atomic register access.
20397  Precondition:
20398  None.
20399  Parameters:
20400  index - Identifier for the device instance to be configured
20401  Returns:
20402  None.
20403  Example:
20404  <code>
20405 
20406  // Enable Change Notification
20407  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20408 
20409  </code>
20410  Remarks:
20411  This function is only available in devices without PPS. For PPS devices, use the
20412  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20413 
20414  This feature may not be available on all devices. Please refer to the
20415  specific device data sheet to determine availability or use
20416  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20417  this feature is available.
20418 */
20419 
20420 void
20422  PORTS_MODULE_ID index ) ;
20423 // *****************************************************************************
20424 /* Function:
20425  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20426  Summary:
20427  Global Change Notice disable.
20428  Description:
20429  This function disables the global Change Notice feature.
20430  Precondition:
20431  None.
20432  Parameters:
20433  index - Identifier for the device instance to be configured
20434  Returns:
20435  None.
20436  Example:
20437  <code>
20438 
20439  // Disable Change Notification
20440  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20441 
20442  </code>
20443  Remarks:
20444  This function is only available in devices without PPS. For PPS devices, use the
20445  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20446 
20447  This feature may not be available on all devices. Please refer to the
20448  specific device data sheet to determine availability or use
20449  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20450  this feature is available.
20451 */
20452 
20453 void
20455  PORTS_MODULE_ID index ) ;
20456 // *****************************************************************************
20457 /* Function:
20458  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20459  PORTS_CHANGE_NOTICE_PIN pinNum )
20460  Summary:
20461  Port pin Change Notice interrupt enable.
20462  Description:
20463  This function enables the port pin Change Notice feature.
20464  This function performs atomic register access.
20465  Precondition:
20466  None.
20467  Parameters:
20468  index - Identifier for the device instance to be configured
20469  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20470  Returns:
20471  None.
20472  Example:
20473  <code>
20474 
20475  // Enable Change Notice interrupt for pin CN13
20476  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20477 
20478  </code>
20479  Remarks:
20480  This function is only available in devices without PPS. For PPS devices, use the
20481  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20482 
20483  This feature may not be available on all devices. Please refer to the
20484  specific device data sheet to determine availability or use
20485  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20486  this feature is available.
20487 */
20488 
20489 void
20491  PORTS_MODULE_ID index ,
20492  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20493 // *****************************************************************************
20494 /* Function:
20495  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20496  PORTS_CHANGE_NOTICE_PIN pinNum )
20497  Summary:
20498  Port pin Change Notice disable.
20499  Description:
20500  This function disables the port pin Change Notice feature.
20501  This function performs atomic register access.
20502  Precondition:
20503  None.
20504  Parameters:
20505  index - Identifier for the device instance to be configured
20506  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20507  Returns:
20508  None.
20509  Example:
20510  <code>
20511 
20512  // Disable Change Notice interrupt for pin CN13
20513  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20514 
20515  </code>
20516  Remarks:
20517  This function is only available in devices without PPS. For PPS devices, use the
20518  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20519 
20520  This feature may not be available on all devices. Please refer to the
20521  specific device data sheet to determine availability or use
20522  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20523  this feature is available.
20524 */
20525 
20526 void
20528  PORTS_MODULE_ID index ,
20529  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20530 // *****************************************************************************
20531 /* Function:
20532  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20533  Summary:
20534  CPU Idle mode does not affect Change Notice operation.
20535  Description:
20536  This function makes sure that Change Notice feature continues working in
20537  Idle mode.
20538  This function performs atomic register access.
20539 
20540  Precondition:
20541  None.
20542  Parameters:
20543  index - Identifier for the device instance to be configured
20544  Returns:
20545  None.
20546  Example:
20547  <code>
20548 
20549  // Change notification feature will be working even when CPU goes to
20550  // Idle mode
20551  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20552 
20553  </code>
20554  Remarks:
20555  This function is only available in devices without PPS. For PPS devices, use the
20556  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20557 
20558  This feature may not be available on all devices. Please refer to the
20559  specific device data sheet to determine availability or use
20560  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20561  this feature is available.
20562 */
20563 
20564 void
20566  PORTS_MODULE_ID index ) ;
20567 // *****************************************************************************
20568 /* Function:
20569  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20570  Summary:
20571  CPU Idle halts the Change Notice operation.
20572  Description:
20573  This function halts the Change Notice operation when the CPU enters
20574  Idle mode.
20575  This function performs atomic register access.
20576  Precondition:
20577  None.
20578  Parameters:
20579  index - Identifier for the device instance to be configured
20580  Returns:
20581  None.
20582  Example:
20583  <code>
20584  // Halts the Change notification operation when CPU enters Idle mode
20585  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20586 
20587  </code>
20588  Remarks:
20589  This function is only available in devices without PPS. For PPS devices, use the
20590  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20591 
20592  This feature may not be available on all devices. Please refer to the
20593  specific device data sheet to determine availability or use
20594  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20595  this feature is available.
20596 */
20597 
20598 void
20600  PORTS_MODULE_ID index ) ;
20601 // *****************************************************************************
20602 /* Function:
20603  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20604  PORTS_CHANGE_NOTICE_PIN pinNum )
20605  Summary:
20606  Enable pull-up on input change.
20607  Description:
20608  This function enables pull-up on selected input change notification pin.
20609  This function performs atomic register access.
20610  Precondition:
20611  None.
20612  Parameters:
20613  index - Identifier for the device instance to be configured
20614  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20615  Returns:
20616  None.
20617  Example:
20618  <code>
20619 
20620  // Enable pull-up on pin CN13
20621  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20622 
20623  </code>
20624  Remarks:
20625  This function is only available in devices without PPS. For PPS devices, use the
20626  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20627 
20628  This feature may not be available on all devices. Please refer to the
20629  specific device data sheet to determine availability or use
20630  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20631  this feature is available.
20632 */
20633 
20634 void
20636  PORTS_MODULE_ID index ,
20637  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20638 // *****************************************************************************
20639 /* Function:
20640  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20641  PORTS_CHANGE_NOTICE_PIN pinNum )
20642  Summary:
20643  Disable pull-up on input change.
20644  Description:
20645  This function disables pull-up on selected input change notification pin.
20646  This function performs atomic register access.
20647  Precondition:
20648  None.
20649  Parameters:
20650  index - Identifier for the device instance to be configured
20651  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20652  Returns:
20653  None.
20654  Example:
20655  <code>
20656 
20657  // Disable pull-up on pin CN13
20658  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20659 
20660  </code>
20661  Remarks:
20662  This function is only available in devices without PPS. For PPS devices, use the
20663  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20664 
20665  This feature may not be available on all devices. Please refer to the
20666  specific device data sheet to determine availability or use
20667  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20668  this feature is available.
20669 */
20670 
20671 void
20673  PORTS_MODULE_ID index ,
20674  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20675 // *****************************************************************************
20676 /* Function:
20677  void PLIB_PORTS_ChannelSlewRateSelect
20678  (
20679  PORTS_MODULE_ID index,
20680  PORTS_CHANNEL channel,
20681  PORTS_DATA_MASK channelMask,
20682  PORTS_PIN_SLEW_RATE slewRate
20683  );
20684  Summary:
20685  Selects the slew rate for selected channel pins.
20686  Description:
20687  This function selects the slew rate for selected channel pins.
20688  This function does not perform atomic register access.
20689  Precondition:
20690  None.
20691  Parameters:
20692  index - Identifier for the device instance to be configured
20693  channel - Port pin channel
20694  channelMask - Identifies the pins for which slew rate has to be modified.
20695  Slew rate of the pins which corresponding bit is "1" get
20696  modified, slew rate of the other pins remains the same.
20697  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20698  Returns:
20699  None.
20700  Example:
20701  <code>
20702 
20703  // Make slew rate of pins RC5, RC8 and RC13 slowest
20704  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20705  PORT_CHANNEL_C,
20706  0x2120,
20707  PORTS_PIN_SLEW_RATE_SLOWEST);
20708 
20709  </code>
20710  Remarks:
20711  This feature may not be available on all devices. Please refer to the
20712  specific device data sheet to determine availability or use
20713  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20714  whether this feature is available.
20715 */
20716 
20717 void
20719  PORTS_MODULE_ID index ,
20720  PORTS_CHANNEL channel ,
20721  PORTS_DATA_MASK channelMask ,
20722  PORTS_PIN_SLEW_RATE slewRate ) ;
20723 // *****************************************************************************
20724 /* Function:
20725 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20726  (
20727  PORTS_MODULE_ID index,
20728  PORTS_CHANNEL channel,
20729  PORTS_BIT_POS bitPos
20730  );
20731  Summary:
20732  Gets the slew rate for selected port pin.
20733  Description:
20734  This function gets the slew rate of selected port pin.
20735  This function does not perform atomic register access.
20736  Precondition:
20737  None.
20738  Parameters:
20739  index - Identifier for the device instance to be configured
20740  channel - Port pin channel
20741  bitPos - One of the possible values of PORTS_BIT_POS.
20742  Returns:
20743  One of the possible values of PORTS_PIN_SLEW_RATE.
20744  Example:
20745  <code>
20746  PORTS_PIN_SLEW_RATE slewRate;
20747 
20748  // Get the slew rate of pin RC1
20749  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20750 
20751  </code>
20752  Remarks:
20753  This feature may not be available on all devices. Please refer to the
20754  specific device data sheet to determine availability or use
20755  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20756  whether this feature is available.
20757 */
20758 
20759 PORTS_PIN_SLEW_RATE
20761  PORTS_MODULE_ID index ,
20762  PORTS_CHANNEL channel ,
20763  PORTS_BIT_POS bitPos ) ;
20764 // *****************************************************************************
20765 /* Function:
20766  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20767  (
20768  PORTS_MODULE_ID index,
20769  PORTS_CHANNEL channel,
20770  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20771  );
20772  Summary:
20773  Selects the Change Notice style for selected port channel.
20774  Description:
20775  This function selects the Change Notice style (or method) for selected port
20776  channel. It allows user to select whether the Change Notice detection will
20777  happen based on edge transition or level transition on all the CN pins of a
20778  particular channel.
20779  This function does not perform atomic register access.
20780  Precondition:
20781  None.
20782  Parameters:
20783  index - Identifier for the device instance to be configured
20784  channel - Port pin channel
20785  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20786  Returns:
20787  None.
20788  Example:
20789  <code>
20790  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20791  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20792  </code>
20793  Remarks:
20794  This feature may not be available on all devices. Please refer to the
20795  specific device data sheet to determine availability or use
20796  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20797  whether this feature is available.
20798 */
20799 
20800 void
20802  PORTS_MODULE_ID index ,
20803  PORTS_CHANNEL channel ,
20804  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20805 // *****************************************************************************
20806 /* Function:
20807  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20808  (
20809  PORTS_MODULE_ID index,
20810  PORTS_CHANNEL channel
20811  );
20812  Summary:
20813  Gets the Change Notice style for the selected port channel.
20814  Description:
20815  This function gets the Change Notice style (or method) for the selected port
20816  channel.
20817  This function does not perform atomic register access.
20818  Precondition:
20819  None.
20820  Parameters:
20821  index - Identifier for the device instance to be configured
20822  channel - Port pin channel
20823  Returns:
20824  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20825  Example:
20826  <code>
20827  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20828  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20829  </code>
20830  Remarks:
20831  This feature may not be available on all devices. Please refer to the
20832  specific device data sheet to determine availability or use
20833  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20834  whether this feature is available.
20835 */
20836 
20837 PORTS_CHANGE_NOTICE_METHOD
20839  PORTS_MODULE_ID index ,
20840  PORTS_CHANNEL channel ) ;
20841 // *****************************************************************************
20842 /* Function:
20843  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20844  (
20845  PORTS_MODULE_ID index,
20846  PORTS_CHANNEL channel,
20847  PORTS_DATA_MASK edgeRisingMask,
20848  PORTS_DATA_MASK edgeFallingMask
20849  );
20850  Summary:
20851  Enables selected type of edge for selected CN pins.
20852  Description:
20853  This function Enables selected type of edge (falling or rising) for
20854  selected CN pins of a port channel.
20855  This function does not perform atomic register access.
20856  Precondition:
20857  Change Notice method should be selected as
20858  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20859  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20860  Parameters:
20861  index - Identifier for the device instance to be configured
20862  channel - Port pin channel
20863  edgeRisingMask - Identifies the pins for which Change Notice has to be
20864  enabled for rising edge. Change Notice interrupt at rising
20865  edge is enabled for the pins which corresponding bit is
20866  '1', for the other pins it remains the same.
20867  edgeFallingMask - Identifies the pins for which Change Notice has to be
20868  enabled for falling edge. Change Notice interrupt at
20869  falling edge is enabled for the pins which corresponding
20870  bit is '1', for the other pins it remains the same.
20871  Returns:
20872  None.
20873  Example:
20874  <code>
20875  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20876  // RC1 & RC5 pins.
20877  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20878  </code>
20879  Remarks:
20880  This feature is not available on all devices. Please refer to the
20881  specific device data sheet to determine availability or use
20882  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20883  whether this feature is available.
20884 */
20885 
20886 void
20888  PORTS_MODULE_ID index ,
20889  PORTS_CHANNEL channel ,
20890  PORTS_DATA_MASK edgeRisingMask ,
20891  PORTS_DATA_MASK edgeFallingMask ) ;
20892 // *****************************************************************************
20893 /* Function:
20894  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20895  (
20896  PORTS_MODULE_ID index,
20897  PORTS_CHANNEL channel,
20898  PORTS_DATA_MASK edgeRisingMask,
20899  PORTS_DATA_MASK edgeFallingMask
20900  );
20901  Summary:
20902  Disables selected type of edge for selected CN pins.
20903  Description:
20904  This function Disables selected type of edge (falling or rising) for
20905  selected CN pins of a port channel.
20906  This function does not perform atomic register access.
20907  Precondition:
20908  Change Notice method should be selected as
20909  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20910  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20911  Parameters:
20912  index - Identifier for the device instance to be configured
20913  channel - Port pin channel
20914  edgeRisingMask - Identifies the pins for which Change Notice has to be
20915  enabled for rising edge. Change notice interrupt at rising
20916  edge is enabled for the pins which corresponding bit is
20917  '1', for the other pins it remains the same.
20918  edgeFallingMask - Identifies the pins for which Change Notice has to be
20919  enabled for falling edge. Change notice interrupt at
20920  falling edge is enabled for the pins which corresponding
20921  bit is '1', for the other pins it remains the same.
20922  Returns:
20923  None.
20924  Example:
20925  <code>
20926  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20927  // RC1 & RC5 pins.
20928  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20929  </code>
20930  Remarks:
20931  This feature is not available on all devices. Please refer to the
20932  specific device data sheet to determine availability or use
20933  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20934  whether this feature is available.
20935 */
20936 
20937 void
20939  PORTS_MODULE_ID index ,
20940  PORTS_CHANNEL channel ,
20941  PORTS_DATA_MASK edgeRisingMask ,
20942  PORTS_DATA_MASK edgeFallingMask ) ;
20943 // *****************************************************************************
20944 /* Function:
20945  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20946  (
20947  PORTS_MODULE_ID index,
20948  PORTS_CHANNEL channel,
20949  PORTS_BIT_POS bitPos,
20950  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20951  );
20952  Summary:
20953  Check if Change Notice edge is enabled or not.
20954  This function does not perform atomic register access.
20955  Description:
20956  This function checks if selected type of Change Notice edge is enabled on a
20957  particular port pin or not.
20958  This function does not perform atomic register access.
20959  Precondition:
20960  None.
20961  Parameters:
20962  index - Identifier for the device instance to be configured
20963  channel - Port pin channel
20964  bitPos - One of the possible values of PORTS_BIT_POS.
20965  cnEdgeType - Type of the edge which has to be checked.
20966 
20967  Returns:
20968  - true - Selected type of Change Notice Edge is enabled.
20969  - false - Selected type of Change Notice Edge is not enabled.
20970 
20971  Example:
20972  <code>
20973  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20974  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20975  {
20976  // do something
20977  }
20978  </code>
20979  Remarks:
20980  This feature is not available on all devices. Please refer to the
20981  specific device data sheet to determine availability or use
20982  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20983  whether this feature is available.
20984 */
20985 
20986 bool
20988  PORTS_MODULE_ID index ,
20989  PORTS_CHANNEL channel ,
20990  PORTS_BIT_POS bitPos ,
20991  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20992 // *****************************************************************************
20993 /* Function:
20994  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
20995  (
20996  PORTS_MODULE_ID index,
20997  PORTS_CHANNEL channel,
20998  PORTS_BIT_POS bitPos
20999  );
21000  Summary:
21001  Check Change Notice edge status.
21002  Description:
21003  This function checks whether or no a Change Notice edge transition has occurred
21004  on the selected port pin.
21005  This function does not perform atomic register access.
21006  Precondition:
21007  None.
21008  Parameters:
21009  index - Identifier for the device instance to be configured
21010  channel - Port pin channel
21011  bitPos - One of the possible values of PORTS_BIT_POS
21012 
21013  Returns:
21014  - true - Change Notice edge transition has occurred
21015  - false - Change Notice edge transition has not occurred
21016 
21017  Example:
21018  <code>
21019  // Check if Change Notice edge transition has occurred for pin RC1.
21020  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21021  {
21022  // do something
21023  }
21024  </code>
21025  Remarks:
21026  This feature is not available on all devices. Please refer to the
21027  specific device data sheet to determine availability or use
21028  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21029  whether this feature is available.
21030 */
21031 
21032 bool
21034  PORTS_MODULE_ID index ,
21035  PORTS_CHANNEL channel ,
21036  PORTS_BIT_POS bitPos ) ;
21037 // *****************************************************************************
21038 // *****************************************************************************
21039 // Section: Ports Peripheral Library Exists Functions
21040 // *****************************************************************************
21041 // *****************************************************************************
21042 /* The functions below indicate the existence of the features on the device.
21043 */
21044 //******************************************************************************
21045 /* Function:
21046  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21047  Summary:
21048  Identifies whether the RemapInput feature exists on the Ports module.
21049  Description:
21050  This function identifies whether the RemapInput feature is available on the
21051  Ports module.
21052  When this function returns true, this function is supported on the device:
21053  - PLIB_PORTS_RemapInput
21054  Preconditions:
21055  None.
21056  Parameters:
21057  index - Identifier for the device instance
21058  Returns:
21059  - true - The RemapInput feature is supported on the device
21060  - false - The RemapInput feature is not supported on the device
21061  Remarks:
21062  None.
21063 */
21064 
21065 bool
21067  PORTS_MODULE_ID index ) ;
21068 //******************************************************************************
21069 /* Function:
21070  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21071  Summary:
21072  Identifies whether the RemapOutput feature exists on the Ports module.
21073  Description:
21074  This function identifies whether the RemapOutput feature is available on the
21075  Ports module.
21076  When this function returns true, this function is supported on the device:
21077  - PLIB_PORTS_RemapOutput
21078  Preconditions:
21079  None.
21080  Parameters:
21081  index - Identifier for the device instance
21082  Returns:
21083  - true - The RemapOutput feature is supported on the device
21084  - false - The RemapOutput feature is not supported on the device
21085  Remarks:
21086  None.
21087 */
21088 
21089 bool
21091  PORTS_MODULE_ID index ) ;
21092 //******************************************************************************
21093 /* Function:
21094  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21095  Summary:
21096  Identifies whether the PinMode feature exists on the Ports module.
21097  Description:
21098  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21099  feature is available on the Ports module.
21100  When this function returns true, this function is supported on the device:
21101  - PLIB_PORTS_PinModeSelect
21102  Preconditions:
21103  None.
21104  Parameters:
21105  index - Identifier for the device instance
21106  Returns:
21107  - true - The PinMode feature is supported on the device
21108  - false - The PinMode feature is not supported on the device
21109  Remarks:
21110  None.
21111 */
21112 
21113 bool
21115  PORTS_MODULE_ID index ) ;
21116 //******************************************************************************
21117 /* Function:
21118  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21119  Summary:
21120  Identifies whether the AnPinsMode feature exists on the Ports module.
21121  Description:
21122  This function identifies whether the AnPinsMode feature is available on the
21123  Ports module.
21124  When this function returns true, this function is supported on the device:
21125  - PLIB_PORTS_AnPinsModeSelect
21126  Preconditions:
21127  None.
21128  Parameters:
21129  index - Identifier for the device instance
21130  Returns:
21131  - true - The AnPinsMode feature is supported on the device
21132  - false - The AnPinsMode feature is not supported on the device
21133  Remarks:
21134  None.
21135 */
21136 
21137 bool
21139  PORTS_MODULE_ID index ) ;
21140 //******************************************************************************
21141 /* Function:
21142  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21143  Summary:
21144  Identifies whether the PortsRead feature exists on the Ports module.
21145  Description:
21146  This function identifies whether the PortsRead feature is available on the
21147  Ports module.
21148  When this function returns true, these functions are supported on the device:
21149  - PLIB_PORTS_PinGet
21150  - PLIB_PORTS_Read
21151  Preconditions:
21152  None.
21153  Parameters:
21154  index - Identifier for the device instance
21155  Returns:
21156  - true - The PortsRead feature is supported on the device
21157  - false - The PortsRead feature is not supported on the device
21158  Remarks:
21159  None.
21160 */
21161 
21162 bool
21164  PORTS_MODULE_ID index ) ;
21165 //******************************************************************************
21166 /* Function:
21167  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21168  Summary:
21169  Identifies whether the LatchRead feature exists on the Ports module.
21170  Description:
21171  This function identifies whether the LatchRead feature is available on the
21172  Ports module.
21173  When this function returns true, these functions are supported on the device:
21174  - PLIB_PORTS_PinGetLatched
21175  - PLIB_PORTS_ReadLatched
21176  Preconditions:
21177  None.
21178  Parameters:
21179  index - Identifier for the device instance
21180  Returns:
21181  - true - The LatchRead feature is supported on the device
21182  - false - The LatchRead feature is not supported on the device
21183  Remarks:
21184  None.
21185 */
21186 
21187 bool
21189  PORTS_MODULE_ID index ) ;
21190 //******************************************************************************
21191 /* Function:
21192  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21193  Summary:
21194  Identifies whether the PortsWrite feature exists on the Ports module.
21195  Description:
21196  This function identifies whether the PortsWrite feature is available on the
21197  Ports module.
21198  When this function returns true, these functions are supported on the device:
21199  - PLIB_PORTS_PinWrite
21200  - PLIB_PORTS_PinSet
21201  - PLIB_PORTS_PinClear
21202  - PLIB_PORTS_PinToggle
21203  - PLIB_PORTS_Write
21204  - PLIB_PORTS_Set
21205  - PLIB_PORTS_Toggle
21206  - PLIB_PORTS_Clear
21207  Preconditions:
21208  None.
21209  Parameters:
21210  index - Identifier for the device instance
21211  Returns:
21212  - true - The PortsWrite feature is supported on the device
21213  - false - The PortsWrite feature is not supported on the device
21214  Remarks:
21215  None.
21216 */
21217 
21218 bool
21220  PORTS_MODULE_ID index ) ;
21221 //******************************************************************************
21222 /* Function:
21223  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21224  Summary:
21225  Identifies whether the PortsDirection feature exists on the Ports module.
21226  Description:
21227  This function identifies whether the PortsDirection feature is available on the
21228  Ports module.
21229  When this function returns true, these functions are supported on the device:
21230  - PLIB_PORTS_PinDirectionInputSet
21231  - PLIB_PORTS_PinDirectionOutputSet
21232  - PLIB_PORTS_DirectionInputSet
21233  - PLIB_PORTS_DirectionOutputSet
21234  - PLIB_PORTS_DirectionGet
21235  Preconditions:
21236  None.
21237  Parameters:
21238  index - Identifier for the device instance
21239  Returns:
21240  - true - The PortsDirection feature is supported on the device
21241  - false - The PortsDirection feature is not supported on the device
21242  Remarks:
21243  None.
21244 */
21245 
21246 bool
21248  PORTS_MODULE_ID index ) ;
21249 //******************************************************************************
21250 /* Function:
21251  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21252  Summary:
21253  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21254  Description:
21255  This function identifies whether the PortsOpenDrain feature is available on
21256  the Ports module.
21257  When this function returns true, these functions are supported on the device:
21258  - PLIB_PORTS_PinOpenDrainEnable
21259  - PLIB_PORTS_PinOpenDrainDisable
21260  - PLIB_PORTS_OpenDrainEnable
21261  - PLIB_PORTS_OpenDrainDisable
21262  Preconditions:
21263  None.
21264  Parameters:
21265  index - Identifier for the device instance
21266  Returns:
21267  - true - The PortsOpenDrain feature is supported on the device
21268  - false - The PortsOpenDrain feature is not supported on the device
21269  Remarks:
21270  None.
21271 */
21272 
21273 bool
21275  PORTS_MODULE_ID index ) ;
21276 //******************************************************************************
21277 /* Function:
21278  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21279  Summary:
21280  Identifies whether the ChangeNotice feature exists on the Ports module.
21281  Description:
21282  This function identifies whether the ChangeNotice feature is available on the
21283  Ports module.
21284  When this function returns true, these functions are supported on the device:
21285  - PLIB_PORTS_ChangeNoticeEnable
21286  - PLIB_PORTS_ChangeNoticeDisable
21287  Preconditions:
21288  None.
21289  Parameters:
21290  index - Identifier for the device instance
21291  Returns:
21292  - true - The ChangeNotice feature is supported on the device
21293  - false - The ChangeNotice feature is not supported on the device
21294  Remarks:
21295  None.
21296 */
21297 
21298 bool
21300  PORTS_MODULE_ID index ) ;
21301 //******************************************************************************
21302 /* Function:
21303  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21304  Summary:
21305  Identifies whether the PinChangeNotice feature exists on the Ports module.
21306  Description:
21307  This function identifies whether the PinChangeNotice feature is available on
21308  the Ports module.
21309  When this function returns true, these functions are supported on the device:
21310  - PLIB_PORTS_PinChangeNoticeEnable
21311  - PLIB_PORTS_PinChangeNoticeDisable
21312  - PLIB_PORTS_CnPinsEnable
21313  - PLIB_PORTS_CnPinsDisable
21314  Preconditions:
21315  None.
21316  Parameters:
21317  index - Identifier for the device instance
21318  Returns:
21319  - true - The PinChangeNotice feature is supported on the device
21320  - false - The PinChangeNotice feature is not supported on the device
21321  Remarks:
21322  None.
21323 */
21324 
21325 bool
21327  PORTS_MODULE_ID index ) ;
21328 //******************************************************************************
21329 /* Function:
21330  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21331  Summary:
21332  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21333  Description:
21334  This function identifies whether the ChangeNoticeInIdle feature is available
21335  on the Ports module.
21336  When this function returns true, these functions are supported on the device:
21337  - PLIB_PORTS_ChangeNoticeInIdleEnable
21338  - PLIB_PORTS_ChangeNoticeInIdleDisable
21339  Preconditions:
21340  None.
21341  Parameters:
21342  index - Identifier for the device instance
21343  Returns:
21344  - true - The ChangeNoticeInIdle feature is supported on the device
21345  - false - The ChangeNoticeInIdle feature is not supported on the device
21346  Remarks:
21347  None.
21348 */
21349 
21350 bool
21352  PORTS_MODULE_ID index ) ;
21353 //******************************************************************************
21354 /* Function:
21355  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21356  Summary:
21357  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21358  Description:
21359  This function identifies whether the ChangeNoticePullup feature is available
21360  on the Ports module.
21361  When this function returns true, these functions are supported on the device:
21362  - PLIB_PORTS_ChangeNoticePullUpEnable
21363  - PLIB_PORTS_ChangeNoticePullUpDisable
21364  - PLIB_PORTS_CnPinsPullUpEnable
21365  - PLIB_PORTS_CnPinsPullUpDisable
21366  Preconditions:
21367  None.
21368  Parameters:
21369  index - Identifier for the device instance
21370  Returns:
21371  - true - The ChangeNoticePullup feature is supported on the device
21372  - false - The ChangeNoticePullup feature is not supported on the device
21373  Remarks:
21374  None.
21375 */
21376 
21377 bool
21379  PORTS_MODULE_ID index ) ;
21380 //******************************************************************************
21381 /* Function:
21382  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21383  Summary:
21384  Identifies whether the PinModePerPort feature exists on the Ports module.
21385  Description:
21386  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21387  feature is available on the Ports module.
21388  When this function returns true, these functions are supported on the device:
21389  - PLIB_PORTS_PinModePerPortSelect
21390  - PLIB_PORTS_ChannelModeSelect
21391  Preconditions:
21392  None.
21393  Parameters:
21394  index - Identifier for the device instance
21395  Returns:
21396  - true - The PinModePerPort feature is supported on the device
21397  - false - The PinModePerPort feature is not supported on the device
21398  Remarks:
21399  None.
21400 */
21401 
21402 bool
21404  PORTS_MODULE_ID index ) ;
21405 //******************************************************************************
21406 /* Function:
21407  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21408  Summary:
21409  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21410  Ports module.
21411  Description:
21412  This function identifies whether the ChangeNoticePullDownPerPort feature is
21413  available on the Ports module.
21414  When this function returns true, these functions are supported on the device:
21415  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21416  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21417  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21418  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21419  Preconditions:
21420  None.
21421  Parameters:
21422  index - Identifier for the device instance
21423  Returns:
21424  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21425  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21426  Remarks:
21427  None.
21428 */
21429 
21430 bool
21432  PORTS_MODULE_ID index ) ;
21433 //******************************************************************************
21434 /* Function:
21435  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21436  Summary:
21437  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21438  module.
21439  Description:
21440  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21441  on the Ports module.
21442  When this function returns true, these functions are supported on the device:
21443  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21444  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21445  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21446  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21447  Preconditions:
21448  None.
21449  Parameters:
21450  index - Identifier for the device instance
21451  Returns:
21452  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21453  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21454  Remarks:
21455  None.
21456 */
21457 
21458 bool
21460  PORTS_MODULE_ID index ) ;
21461 //******************************************************************************
21462 /* Function:
21463  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21464  Summary:
21465  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21466  module.
21467  Description:
21468  This function identifies whether the PinChangeNoticePerPort feature is
21469  available on the Ports module.
21470  When this function returns true, these functions are supported on the device:
21471  - PLIB_PORTS_PinChangeNoticePerPortEnable
21472  - PLIB_PORTS_PinChangeNoticePerPortDisable
21473  - PLIB_PORTS_ChannelChangeNoticeEnable
21474  - PLIB_PORTS_ChannelChangeNoticeDisable
21475  Preconditions:
21476  None.
21477  Parameters:
21478  index - Identifier for the device instance
21479  Returns:
21480  - true - The PinChangeNoticePerPort feature is supported on the device
21481  - false - The PinChangeNoticePerPort feature is not supported on the device
21482  Remarks:
21483  None.
21484 */
21485 
21486 bool
21488  PORTS_MODULE_ID index ) ;
21489 //******************************************************************************
21490 /* Function:
21491  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21492  Summary:
21493  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21494  module.
21495  Description:
21496  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21497  available on the Ports module.
21498  When this function returns true, these functions are supported on the device:
21499  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21500  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21501  Preconditions:
21502  None.
21503  Parameters:
21504  index - Identifier for the device instance
21505  Returns:
21506  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21507  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21508  Remarks:
21509  None.
21510 */
21511 
21512 bool
21514  PORTS_MODULE_ID index ) ;
21515 //******************************************************************************
21516 /* Function:
21517  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21518  Summary:
21519  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21520  module.
21521  Description:
21522  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21523  available on the Ports module.
21524  When this function returns true, these functions are supported on the device:
21525  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21526  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21527  Preconditions:
21528  None.
21529  Parameters:
21530  index - Identifier for the device instance
21531  Returns:
21532  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21533  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21534  Remarks:
21535  None.
21536 */
21537 
21538 bool
21540  PORTS_MODULE_ID index ) ;
21541 //******************************************************************************
21542 /* Function:
21543  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21544  Summary:
21545  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21546  module.
21547  Description:
21548  This function identifies whether the ChangeNoticePerPortStatus feature is
21549  available on the Ports module.
21550  When this function returns true, these functions are supported on the device:
21551  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21552  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21553  Preconditions:
21554  None.
21555  Parameters:
21556  index - Identifier for the device instance
21557  Returns:
21558  - true - The ChangeNoticePerPortStatus feature is supported on the device
21559  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21560  Remarks:
21561  None.
21562 */
21563 
21564 bool
21566  PORTS_MODULE_ID index ) ;
21567 //******************************************************************************
21568 /* Function:
21569  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21570  Summary:
21571  Identifies whether the SlewRateControl feature exists on the Ports module.
21572  Description:
21573  This function identifies whether the SlewRateControl feature is available
21574  on the Ports module.
21575  When this function returns true, these functions are supported on the device:
21576  - PLIB_PORTS_ChannelSlewRateSelect
21577  - PLIB_PORTS_PinSlewRateGet
21578  Preconditions:
21579  None.
21580  Parameters:
21581  index - Identifier for the device instance
21582  Returns:
21583  - true - The SlewRateControl feature is supported on the device
21584  - false - The SlewRateControl feature is not supported on the device
21585  Remarks:
21586  None.
21587 */
21588 
21589 bool
21591  PORTS_MODULE_ID index ) ;
21592 //******************************************************************************
21593 /* Function:
21594  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21595  Summary:
21596  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21597  Ports module.
21598  Description:
21599  This function identifies whether the ChannelChangeNoticeMethod feature is
21600  available on the Ports module.
21601  When this function returns true, these functions are supported on the device:
21602  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21603  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21604  Preconditions:
21605  None.
21606  Parameters:
21607  index - Identifier for the device instance
21608  Returns:
21609  - true - The ChannelChangeNoticeMethod feature is supported on the device
21610  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21611  Remarks:
21612  None.
21613 */
21614 
21615 bool
21617  PORTS_MODULE_ID index ) ;
21618 //******************************************************************************
21619 /* Function:
21620  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21621  Summary:
21622  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21623  module.
21624  Description:
21625  This function identifies whether the ChangeNoticeEdgeControl feature is
21626  available on the Ports module.
21627  When this function returns true, these functions are supported on the device:
21628  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21629  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21630  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21631  Preconditions:
21632  None.
21633  Parameters:
21634  index - Identifier for the device instance
21635  Returns:
21636  - true - The ChangeNoticeEdgeControl feature is supported on the device
21637  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21638  Remarks:
21639  None.
21640 */
21641 
21642 bool
21644  PORTS_MODULE_ID index ) ;
21645 //******************************************************************************
21646 /* Function:
21647  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21648  Summary:
21649  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21650  module.
21651  Description:
21652  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21653  on the Ports module.
21654  When this function returns true, this function is supported on the device:
21655  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21656  Preconditions:
21657  None.
21658  Parameters:
21659  index - Identifier for the device instance
21660  Returns:
21661  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21662  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21663  Remarks:
21664  None.
21665 */
21666 
21667 bool
21669  PORTS_MODULE_ID index ) ;
21670 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21671 /*******************************************************************************
21672  Ports Peripheral Library Compatibility Header
21673  Company:
21674  Microchip Technology Inc.
21675  File Name:
21676  plib_ports_compatibility.h
21677  Summary:
21678  Ports Peripheral Library Interface header for backward compatibility.
21679  Description:
21680  This header file contains the definitions of the functions which are
21681  supported for backward compatibility only. These will be deprecated later.
21682 *******************************************************************************/
21683 // DOM-IGNORE-BEGIN
21684 /*******************************************************************************
21685 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21686 Microchip licenses to you the right to use, modify, copy and distribute
21687 Software only when embedded on a Microchip microcontroller or digital signal
21688 controller that is integrated into your product or third party product
21689 (pursuant to the sublicense terms in the accompanying license agreement).
21690 You should refer to the license agreement accompanying this Software for
21691 additional information regarding your rights and obligations.
21692 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21693 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21694 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21695 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21696 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21697 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21698 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21699 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21700 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21701 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21702 *******************************************************************************/
21703 // DOM-IGNORE-END
21704 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21705 #define _PLIB_PORTS_COMPATIBILITY_H
21706 #include <stdint.h>
21707 #include <stddef.h>
21708 // *****************************************************************************
21709 /* Function:
21710  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21711  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21712  Summary:
21713  checks the status of change on the pin
21714  Description:
21715  This function checks if the change has occurred on the given pin or not.
21716  Precondition:
21717  None.
21718  Parameters:
21719  index - Identifier for the device instance to be configured
21720  channel - Port pin channel
21721  bitPos - Position in the PORT pins
21722  Returns:
21723  None.
21724  Example:
21725  <code>
21726 
21727  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21728  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21729  {
21730  //do something
21731  }
21732 
21733  </code>
21734  Remarks:
21735  This feature may not be available on all devices. Please refer to the
21736  specific device data sheet to determine availability or use
21737  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21738  whether this feature is available.
21739 
21740  This function will be deprecated later.
21741 */
21742 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21743  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21744 /*******************************************************************************
21745  End of File
21746 */
21747 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21748 /* CLOSE_FILE Include File */
21749 
21750 //DOM-IGNORE-BEGIN
21751 //DOM-IGNORE-END
21752  // #ifndef _PLIB_PORTS_H
21753 /*******************************************************************************
21754  End of File
21755 */
21756 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21757 /* CLOSE_FILE Include File */
21758 
21759 #include "system/int/sys_int.h"
21760 // *****************************************************************************
21761 // *****************************************************************************
21762 // Section: SYS PORTS Data Types
21763 // *****************************************************************************
21764 // *****************************************************************************
21765 // *****************************************************************************
21766 /* SYS PORTS PULLUP status
21767  Summary:
21768  Provides the pull-up and pull-down status.
21769  Description:
21770  These constants provide the pull-up or pull-down status definitions.
21771  Remarks:
21772  None.
21773 */
21774 
21775 typedef
21776  enum
21777  {
21778  /* PULLUP Disable */
21780  /*DOM-IGNORE-BEGIN*/
21781  = 0 /*DOM-IGNORE-END*/
21782  ,
21783  /* PULLUP Enable */
21785  /*DOM-IGNORE-BEGIN*/
21786  = 1 /*DOM-IGNORE-END*/
21787  ,
21789 // *****************************************************************************
21790 /* SYS PORTS PIN DIRECTION
21791  Summary:
21792  Defines the direction of the port pins.
21793  Description:
21794  These constants provide the port pin direction definitions.
21795  Remarks:
21796  None.
21797 */
21798 
21799 typedef
21800  enum
21801  {
21802  /* Direction as output */
21804  /*DOM-IGNORE-BEGIN*/
21805  = 0 /*DOM-IGNORE-END*/
21806  ,
21807  /* Direction as input */
21809  /*DOM-IGNORE-BEGIN*/
21810  = 1 /*DOM-IGNORE-END*/
21811  ,
21813 
21814 typedef
21815  enum
21816  {
21819  // #ifndef _SYS_PORTS_DEFINITIONS_H
21820 /*******************************************************************************
21821  End of File
21822 */
21823 
21824 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21825 /* CLOSE_FILE Include File */
21826 
21827 // DOM-IGNORE-BEGIN
21828 // DOM-IGNORE-END
21829 // *****************************************************************************
21830 // *****************************************************************************
21831 // Section: SYS PorTS Module Initialization Routine
21832 // *****************************************************************************
21833 // *****************************************************************************
21834 // *****************************************************************************
21835 /* Function:
21836  void SYS_PORTS_Initialize()
21837  Summary:
21838  Initializes PORT Pins/Channels.
21839  <p><b>Implementation:</b> Static/Dynamic</p>
21840  Description:
21841  This function initializes different port pins/channels to the desired state.
21842  It also remaps the pins to the desired specific function.
21843  Precondition:
21844  None.
21845  Parameters:
21846  None.
21847  Returns:
21848  None.
21849  Example:
21850  <code>
21851  SYS_PORTS_Initialize();
21852  </code>
21853  Remarks:
21854  This API must be be called at the time of system initialization to
21855  initialize the ports pins.
21856 */
21857 
21858 void
21860 // *****************************************************************************
21861 // *****************************************************************************
21862 // Section: SYS PORTS CONTROL Routines
21863 // *****************************************************************************
21864 // *****************************************************************************
21865 // *****************************************************************************
21866 /* Function:
21867  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21868  Summary:
21869  Reads the data from the I/O port.
21870  <p><b>Implementation:</b> Dynamic</p>
21871  Description:
21872  This function reads the data from the I/O port.
21873  Preconditions:
21874  The direction of the port to be set as input.
21875  Parameters:
21876  index - Identifier for the device instance to be configured
21877  channel - Identifier for the PORT channel: A, B, C, etc.
21878  Returns:
21879  Returns the data read from the port.
21880  Example:
21881  <code>
21882  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21883  // application developer.
21884  PORTS_DATA_TYPE readData;
21885  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21886  </code>
21887  Remarks:
21888  None.
21889 */
21890 
21892  SYS_PORTS_Read (
21893  PORTS_MODULE_ID index ,
21894  PORTS_CHANNEL channel ) ;
21895 // *****************************************************************************
21896 /* Function:
21897  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21898  PORTS_CHANNEL channel,
21899  PORTS_DATA_TYPE value )
21900  Summary:
21901  Writes the data to the I/O port.
21902  <p><b>Implementation:</b> Dynamic</p>
21903  Description:
21904  This function writes the data to the I/O port.
21905  Preconditions:
21906  The direction of the port to be set as output.
21907  Parameters:
21908  index - Identifier for the device instance to be configured
21909  channel - Identifier for the PORT channel: A, B, C, etc.
21910  value - Value to be written into a port of width PORTS_DATA_TYPE
21911  Returns:
21912  None.
21913  Example:
21914  <code>
21915  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21916  // application developer.
21917  PORTS_DATA_TYPE writeData;
21918  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21919  </code>
21920  Remarks:
21921  None.
21922 */
21923 
21924 void
21925  SYS_PORTS_Write (
21926  PORTS_MODULE_ID index ,
21927  PORTS_CHANNEL channel ,
21928  PORTS_DATA_TYPE value ) ;
21929 // *****************************************************************************
21930 /* Function:
21931  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21932  Summary:
21933  Reads the data driven on the I/O port.
21934  <p><b>Implementation:</b> Dynamic</p>
21935  Description:
21936  This function reads the data driven on the I/O port.
21937  Preconditions:
21938  The direction of the port to be set as output.
21939  Parameters:
21940  index - Identifier for the device instance to be configured
21941  channel - Identifier for the PORT channel: A, B, C, etc.
21942  Returns:
21943  Returns the data driven on the port.
21944  Example:
21945  <code>
21946  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21947  // application developer.
21948  PORTS_DATA_TYPE drivenData;
21949  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21950  </code>
21951  Remarks:
21952  None.
21953 */
21954 
21957  PORTS_MODULE_ID index ,
21958  PORTS_CHANNEL channel ) ;
21959 // *****************************************************************************
21960 /* Function:
21961  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21962  PORTS_DATA_TYPE value,
21963  PORTS_DATA_MASK mask )
21964  Summary:
21965  Sets the selected digital port/latch based on the mask.
21966  <p><b>Implementation:</b> Dynamic</p>
21967  Description:
21968  This function Sets the selected digital port/latch relative to the mask.
21969  This function "AND" value and mask parameters and then set the bits
21970  in the port channel that were set in the result of the ANDing operation.
21971  Preconditions:
21972  None.
21973  Parameters:
21974  index - Identifier for the device instance to be configured
21975  channel - Identifier for the PORT channel: A, B, C, etc.
21976  value - Consists of information about which port bit has to be set
21977  mask - Identifies the bits which could be intended for setting
21978  Returns:
21979  None.
21980  Example:
21981  <code>
21982  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21983  // application developer.
21984  // MY_VALUE - 0x1234
21985  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21986  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21987  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21988  </code>
21989  Remarks:
21990  Not all features are available on all devices. Refer to the specific device
21991  data sheet for availability.
21992 */
21993 
21994 void
21995  SYS_PORTS_Set (
21996  PORTS_MODULE_ID index ,
21997  PORTS_CHANNEL channel ,
21998  PORTS_DATA_TYPE value ,
21999  PORTS_DATA_MASK mask ) ;
22000 // *****************************************************************************
22001 /* Function:
22002  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22003  PORTS_DATA_MASK clearMask )
22004  Summary:
22005  Clears the selected digital port.
22006  <p><b>Implementation:</b> Dynamic</p>
22007  Description:
22008  This function clears the selected digital port.
22009  Preconditions:
22010  None.
22011  Parameters:
22012  index - Identifier for the device instance to be configured
22013  channel - Identifier for the PORT channel: A, B, C, etc.
22014  clearMask - Identifies the bits to be cleared
22015  Returns:
22016  None.
22017  Example:
22018  <code>
22019  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22020  // application developer.
22021  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22022  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22023  </code>
22024  Remarks:
22025  Not all features are available on all devices. Refer to the specific device
22026  data sheet for availability.
22027 */
22028 
22029 void
22030  SYS_PORTS_Clear (
22031  PORTS_MODULE_ID index ,
22032  PORTS_CHANNEL channel ,
22033  PORTS_DATA_MASK clearMask ) ;
22034 // *****************************************************************************
22035 /* Function:
22036  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22037  SYS_PORTS_PIN_DIRECTION pinDir,
22038  PORTS_CHANNEL channel,
22039  PORTS_DATA_MASK mask )
22040  Summary:
22041  Enables the direction for the selected port.
22042  <p><b>Implementation:</b> Dynamic</p>
22043  Description:
22044  This function enables the direction for the selected port.
22045  Preconditions:
22046  None.
22047  Parameters:
22048  index - Identifier for the device instance to be configured
22049  pinDir - Pin direction
22050  channel - Identifier for the PORT channel: A, B, C, etc.
22051  mask - Mask for the direction of width PORTS_DATA_MASK
22052  Returns:
22053  None
22054  Example:
22055  <code>
22056  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22057  // application developer.
22058  SYS_PORTS_PIN_DIRECTION pinDir;
22059  pinDir = SYS_PORTS_DIRECTION_INPUT;
22060  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22061  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22062  </code>
22063  Remarks:
22064  None.
22065 */
22066 
22067 void
22069  PORTS_MODULE_ID index ,
22070  SYS_PORTS_PIN_DIRECTION pinDir ,
22071  PORTS_CHANNEL channel ,
22072  PORTS_DATA_MASK mask ) ;
22073 // *****************************************************************************
22074 /* Function:
22075  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22076  Summary:
22077  Reads the direction for the selected port.
22078  <p><b>Implementation:</b> Dynamic</p>
22079  Description:
22080  This function reads the direction for the selected port.
22081  Preconditions:
22082  None.
22083  Parameters:
22084  index - Identifier for the device instance to be configured
22085  channel - Identifier for the PORT channel: A, B, C, etc.
22086  Returns:
22087  Direction of the port.
22088  Example:
22089  <code>
22090  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22091  // application developer.
22092  PORTS_DATA_MASK value;
22093  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22094  </code>
22095  Remarks:
22096  None.
22097 */
22098 
22101  PORTS_MODULE_ID index ,
22102  PORTS_CHANNEL channel ) ;
22103 // *****************************************************************************
22104 /* Function:
22105  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22106  PORTS_DATA_MASK toggleMask )
22107  Summary:
22108  Toggles the selected digital port pins.
22109  <p><b>Implementation:</b> Dynamic</p>
22110  Description:
22111  This function toggles the selected digital port pins.
22112  Preconditions:
22113  None.
22114  Parameters:
22115  index - Identifier for the device instance to be configured
22116  channel - Identifier for the PORT channel: A, B, C, etc.
22117  toggleMask - Identifies the bits to be toggled
22118  Returns:
22119  None.
22120  Example:
22121  <code>
22122  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22123  // application developer.
22124  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22125  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22126  </code>
22127  Remarks:
22128  None.
22129 */
22130 
22131 void
22133  PORTS_MODULE_ID index ,
22134  PORTS_CHANNEL channel ,
22135  PORTS_DATA_MASK toggleMask ) ;
22136 // *****************************************************************************
22137 /* Function:
22138  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22139  PORTS_DATA_MASK mask )
22140  Summary:
22141  Enables the open-drain functionality for the selected port.
22142  <p><b>Implementation:</b> Dynamic</p>
22143  Description:
22144  This function enables the open-drain functionality for the selected port.
22145  Preconditions:
22146  None.
22147  Parameters:
22148  index - Identifier for the device instance to be configured
22149  channel - Identifier for the PORT channel: A, B, C, etc.
22150  mask - Mask of type PORTS_DATA_MASK
22151  Returns:
22152  None.
22153  Example:
22154  <code>
22155  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22156  // application developer.
22157  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22158  </code>
22159  Remarks:
22160  Not all features are available on all devices. Refer to the specific device
22161  data sheet for availability.
22162 */
22163 
22164 void
22166  PORTS_MODULE_ID index ,
22167  PORTS_CHANNEL channel ,
22168  PORTS_DATA_MASK mask ) ;
22169 // *****************************************************************************
22170 /* Function:
22171  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22172  PORTS_DATA_MASK mask )
22173  Summary:
22174  Disables the open-drain functionality for the selected port.
22175  <p><b>Implementation:</b> Dynamic</p>
22176  Description:
22177  This function disables the open-drain functionality for the selected port.
22178  Preconditions:
22179  None.
22180  Parameters:
22181  index - Identifier for the device instance to be configured
22182  channel - Identifier for the PORT channel: A, B, C, etc.
22183  mask - Mask of type PORTS_DATA_MASK
22184  Returns:
22185  None.
22186  Example:
22187  <code>
22188  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22189  // application developer.
22190  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22191  </code>
22192  Remarks:
22193  Not all features are available on all devices. Refer to the specific device
22194  data sheet for availability.
22195 */
22196 
22197 void
22199  PORTS_MODULE_ID index ,
22200  PORTS_CHANNEL channel ,
22201  PORTS_DATA_MASK mask ) ;
22202 // *****************************************************************************
22203 /* Function:
22204  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22205  (
22206  PORTS_MODULE_ID index,
22207  PORTS_CHANNEL channel
22208  )
22209  Summary:
22210  Reads the interrupt status from the I/O port.
22211  <p><b>Implementation:</b> Dynamic</p>
22212  Description:
22213  This function reads the interrupt status from the I/O port.
22214  Preconditions:
22215  The interrupts should have been configured.
22216  Parameters:
22217  index - Identifier for the device instance to be configured
22218  channel - Identifier for the PORT channel: A, B, C, etc.
22219  Returns:
22220  Returns the interrupt status of the port channel.
22221  Example:
22222  <code>
22223  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22224  // application developer.
22225  PORTS_DATA_TYPE channelStatus;
22226  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22227  </code>
22228  Remarks:
22229  None.
22230 */
22231 
22234  PORTS_MODULE_ID index ,
22235  PORTS_CHANNEL channel ) ;
22236 // *****************************************************************************
22237 // *****************************************************************************
22238 // Section: SYS PORT PINS REMAPING Routines
22239 // *****************************************************************************
22240 // *****************************************************************************
22241 // *****************************************************************************
22242 /* Function:
22243  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22244  PORTS_REMAP_INPUT_FUNCTION function,
22245  PORTS_REMAP_INPUT_PIN remapPin )
22246  Summary:
22247  Input/Output (I/O) function remapping.
22248  <p><b>Implementation:</b> Dynamic</p>
22249  Description:
22250  This function controls the I/O function remapping.
22251  Precondition:
22252  None.
22253  Parameters:
22254  index - Identifier for the device instance to be configured
22255  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22256  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22257  Returns:
22258  None.
22259  Example:
22260  <code>
22261  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22262  // application developer.
22263  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22264  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22265  </code>
22266  Remarks:
22267  This feature may not be available on all devices. Please refer to the
22268  specific device data sheet to determine availability or use
22269  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22270  this feature is available.
22271 */
22272 
22273 void
22275  PORTS_MODULE_ID index ,
22276  PORTS_REMAP_INPUT_FUNCTION function ,
22277  PORTS_REMAP_INPUT_PIN remapPin ) ;
22278 // *****************************************************************************
22279 /* Function:
22280  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22281  PORTS_REMAP_OUTPUT_FUNCTION function,
22282  PORTS_REMAP_OUTPUT_PIN remapPin )
22283  Summary:
22284  Input/Output (I/O) function remapping.
22285  <p><b>Implementation:</b> Dynamic</p>
22286  Description:
22287  This function controls the I/O function remapping.
22288  Precondition:
22289  None.
22290  Parameters:
22291  index - Identifier for the device instance to be configured
22292  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22293  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22294  Returns:
22295  None.
22296  Example:
22297  <code>
22298  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22299  // application developer.
22300  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22301  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22302  </code>
22303  Remarks:
22304  This feature may not be available on all devices. Please refer to the
22305  specific device data sheet to determine availability or use
22306  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22307  this feature is available.
22308 */
22309 
22310 void
22312  PORTS_MODULE_ID index ,
22313  PORTS_REMAP_OUTPUT_FUNCTION function ,
22314  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22315 // *****************************************************************************
22316 // *****************************************************************************
22317 // Section: SYS Change Notification Pins Routines
22318 // *****************************************************************************
22319 // *****************************************************************************
22320 // *****************************************************************************
22321 /* Function:
22322  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22323  Summary:
22324  Globally enables the change notification for the selected port.
22325  <p><b>Implementation:</b> Dynamic</p>
22326  Description:
22327  This function globally enables the change notification for the selected port.
22328  Preconditions:
22329  None.
22330  Parameters:
22331  None.
22332  Returns:
22333  None.
22334  Example:
22335  <code>
22336  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22337  // application developer.
22338  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22339  </code>
22340  Remarks:
22341  Not all features are available on all devices. Refer to the specific device
22342  data sheet for availability.
22343 */
22344 
22345 void
22347  PORTS_MODULE_ID index ) ;
22348 // *****************************************************************************
22349 /* Function:
22350  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22351  Summary:
22352  Globally disables the change notification for the selected port.
22353  <p><b>Implementation:</b> Dynamic</p>
22354  Description:
22355  This function globally disables the change notification for the selected port.
22356  Preconditions:
22357  None.
22358  Parameters:
22359  None.
22360  Returns:
22361  None.
22362  Example:
22363  <code>
22364  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22365  // application developer.
22366  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22367  </code>
22368  Remarks:
22369  Not all features are available on all devices. Refer to the specific device
22370  data sheet for availability.
22371 */
22372 
22373 void
22375  PORTS_MODULE_ID index ) ;
22376 // *****************************************************************************
22377 /* Function:
22378  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22379  PORTS_CHANGE_NOTICE_PIN pinNum,
22380  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22381  Summary:
22382  Enables the change notification for the selected port.
22383  <p><b>Implementation:</b> Dynamic</p>
22384  Description:
22385  This function enables the change notification for the selected port.
22386  Preconditions:
22387  None.
22388  Parameters:
22389  index - Identifier for the device instance to be configured
22390  value - Pull-up enable or disable value
22391  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22392  Returns:
22393  None.
22394  Example:
22395  <code>
22396  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22397  // application developer.
22398  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22399  PORTS_CHANGE_NOTICE_PIN pinNum;
22400  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22401  </code>
22402  Remarks:
22403  Not all features are available on all devices. Refer to the specific device
22404  data sheet for availability.
22405 */
22406 
22407 void
22409  PORTS_MODULE_ID index ,
22410  PORTS_CHANGE_NOTICE_PIN pinNum ,
22412 // *****************************************************************************
22413 /* Function:
22414  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22415  PORTS_CHANGE_NOTICE_PIN pinNum )
22416  Summary:
22417  Disables the change notification for the selected port.
22418  <p><b>Implementation:</b> Dynamic</p>
22419  Description:
22420  This function disables the change notification for the selected port.
22421  Preconditions:
22422  None.
22423  Parameters:
22424  index - Identifier for the device instance to be configured
22425  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22426  Returns:
22427  None.
22428  Example:
22429  <code>
22430  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22431  // application developer.
22432  PORTS_CHANGE_NOTICE_PIN pinNum;
22433  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22434  </code>
22435  Remarks:
22436  Not all features are available on all devices. Refer to the specific device
22437  data sheet for availability.
22438 */
22439 
22440 void
22442  PORTS_MODULE_ID index ,
22443  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22444 // *****************************************************************************
22445 /* Function:
22446  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22447  Summary:
22448  Enables the change notification for the selected port in Sleep or Idle mode.
22449  <p><b>Implementation:</b> Dynamic</p>
22450  Description:
22451  This function enables the change notification for the selected port in Sleep
22452  or Idle mode.
22453  Preconditions:
22454  None.
22455  Parameters:
22456  None.
22457  Returns:
22458  None.
22459  Example:
22460  <code>
22461  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22462  // application developer.
22463  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22464  </code>
22465  Remarks:
22466  Not all features are available on all devices. Refer to the specific device
22467  data sheet for availability.
22468 */
22469 
22470 void
22472  PORTS_MODULE_ID index ) ;
22473 // *****************************************************************************
22474 /* Function:
22475  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22476  Summary:
22477  Disables the change notification for the selected port in Sleep or Idle mode.
22478  <p><b>Implementation:</b> Dynamic</p>
22479  Description:
22480  This function disables the change notification for the selected port in Sleep
22481  or Idle mode.
22482  Preconditions:
22483  None.
22484  Parameters:
22485  None.
22486  Returns:
22487  None.
22488  Example:
22489  <code>
22490  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22491  // application developer.
22492  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22493  </code>
22494  Remarks:
22495  Not all features are available on all devices. Refer to the specific device
22496  data sheet for availability.
22497 */
22498 
22499 void
22501  PORTS_MODULE_ID index ) ;
22502 // *****************************************************************************
22503 /* Function:
22504  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22505  PORTS_CHANGE_NOTICE_PIN pinNum )
22506  Summary:
22507  Enables a weak pull-up on the change notification pin.
22508  <p><b>Implementation:</b> Dynamic</p>
22509  Description:
22510  This function enables a weak pull-up on the change notification pin.
22511  Preconditions:
22512  None.
22513  Parameters:
22514  index - Identifier for the device instance to be configured
22515  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22516  Returns:
22517  None.
22518  Example:
22519  <code>
22520  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22521  // application developer.
22522  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22523  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22524  </code>
22525  Remarks:
22526  Not all features are available on all devices. Refer to the specific device
22527  data sheet for availability.
22528 */
22529 
22530 void
22532  PORTS_MODULE_ID index ,
22533  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22534 // *****************************************************************************
22535 /* Function:
22536  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22537  PORTS_CHANGE_NOTICE_PIN pinNum )
22538  Summary:
22539  Disables a weak pull-up on the change notification pin.
22540  <p><b>Implementation:</b> Dynamic</p>
22541  Description:
22542  This function Disables a weak pull-up on the change notification pin.
22543  Preconditions:
22544  None.
22545  Parameters:
22546  index - Identifier for the device instance to be configured
22547  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22548  Returns:
22549  None.
22550  Example:
22551  <code>
22552  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22553  // application developer.
22554  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22555  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22556  </code>
22557  Remarks:
22558  Not all features are available on all devices. Refer to the specific device
22559  data sheet for availability.
22560 */
22561 
22562 void
22564  PORTS_MODULE_ID index ,
22565  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22566 // *****************************************************************************
22567 // *****************************************************************************
22568 // Section: SYS PORT PINS Control Routines
22569 // *****************************************************************************
22570 // *****************************************************************************
22571 // *****************************************************************************
22572 /* Function:
22573  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22574  PORTS_ANALOG_PIN pin,
22575  PORTS_PIN_MODE mode)
22576  Summary:
22577  Enables the selected pin as analog or digital.
22578  <p><b>Implementation:</b> Dynamic</p>
22579  Description:
22580  This function enables the selected pin as analog or digital.
22581  Preconditions:
22582  None.
22583  Parameters:
22584  index - Identifier for the device instance to be configured
22585  pin - Possible values of PORTS_ANALOG_PIN
22586  mode - Possible values of PORTS_PIN_MODE
22587  Returns:
22588  None.
22589  Example:
22590  <code>
22591  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22592  // application developer.
22593  // MY_PIN - PORTS_ANALOG_PIN_AN0
22594  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22595  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22596  </code>
22597  Remarks:
22598  Not all features are available on all devices. Refer to the specific device
22599  data sheet for availability.
22600 */
22601 
22602 void
22604  PORTS_MODULE_ID index ,
22605  PORTS_ANALOG_PIN pin ,
22606  PORTS_PIN_MODE mode ) ;
22607 // *****************************************************************************
22608 /* Function:
22609  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22610  PORTS_CHANNEL channel,
22611  PORTS_BIT_POS bitPos
22612  bool value )
22613  Summary:
22614  Writes the selected digital pin.
22615  <p><b>Implementation:</b> Dynamic</p>
22616  Description:
22617  This function writes the selected digital pin.
22618  Preconditions:
22619  None.
22620  Parameters:
22621  index - Identifier for the device instance to be configured
22622  channel - Identifier for the PORT channel: A, B, C, etc.
22623  bitPos - Possible values of PORTS_BIT_POS
22624  value - Value to be written to the specific pin/latch:
22625  - true - Sets the bit
22626  - false - Clears the bit
22627  Returns:
22628  None.
22629  Example:
22630  <code>
22631  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22632  // application developer.
22633  // MY_PINNUM - PORTS_PIN_10
22634  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22635  </code>
22636  Remarks:
22637  Not all features are available on all devices. Refer to the specific device
22638  data sheet for availability.
22639 */
22640 
22641 void
22643  PORTS_MODULE_ID index ,
22644  PORTS_CHANNEL channel ,
22645  PORTS_BIT_POS bitPos ,
22646  bool value ) ;
22647 // *****************************************************************************
22648 /* Function:
22649  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22650  PORTS_CHANNEL channel,
22651  PORTS_BIT_POS bitPos )
22652  Summary:
22653  Reads the data driven on the selected digital pin.
22654  <p><b>Implementation:</b> Dynamic</p>
22655  Description:
22656  This function reads the data driven on the selected
22657  digital output pin.
22658  Preconditions:
22659  None.
22660  Parameters:
22661  index - Identifier for the device instance to be configured
22662  channel - Identifier for the PORT channel: A, B, C, etc.
22663  bitPos - Possible values of PORTS_BIT_POS
22664  Returns:
22665  The status of the data driven on the port pin.
22666  Example:
22667  <code>
22668  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22669  // application developer.
22670  // MY_PINNUM - PORTS_PIN_10
22671  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22672  </code>
22673  Remarks:
22674  Not all features are available on all devices. Refer to the specific device
22675  data sheet for availability.
22676 */
22677 
22678 bool
22680  PORTS_MODULE_ID index ,
22681  PORTS_CHANNEL channel ,
22682  PORTS_BIT_POS bitPos ) ;
22683 // *****************************************************************************
22684 /* Function:
22685  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22686  PORTS_CHANNEL channel,
22687  PORTS_BIT_POS bitPos )
22688  Summary:
22689  Reads the selected digital pin.
22690  <p><b>Implementation:</b> Dynamic</p>
22691  Description:
22692  This function reads the selected digital pin, not the Latch.
22693  Preconditions:
22694  None.
22695  Parameters:
22696  index - Identifier for the device instance to be configured
22697  channel - Identifier for the PORT channel: A, B, C, etc.
22698  bitPos - Possible values of PORTS_BIT_POS
22699  Returns:
22700  The status of the port pin.
22701  Example:
22702  <code>
22703  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22704  // application developer.
22705  // MY_PINNUM - PORTS_PIN_10
22706  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22707  </code>
22708  Remarks:
22709  Not all features are available on all devices. Refer to the specific device
22710  data sheet for availability.
22711 */
22712 
22713 bool
22715  PORTS_MODULE_ID index ,
22716  PORTS_CHANNEL channel ,
22717  PORTS_BIT_POS bitPos ) ;
22718 // *****************************************************************************
22719 /* Function:
22720  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22721  PORTS_CHANNEL channel,
22722  PORTS_BIT_POS bitPos )
22723  Summary:
22724  Toggles the selected digital pin.
22725  <p><b>Implementation:</b> Dynamic</p>
22726  Description:
22727  This function toggles the selected digital pin.
22728  Preconditions:
22729  None.
22730  Parameters:
22731  index - Identifier for the device instance to be configured
22732  channel - Identifier for the PORT channel: A, B, C, etc.
22733  bitPos - Possible values of PORTS_BIT_POS
22734  Returns:
22735  None.
22736  Example:
22737  <code>
22738  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22739  // application developer.
22740  // MY_PINNUM - PORTS_PIN_10
22741  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22742  </code>
22743  Remarks:
22744  Not all features are available on all devices. Refer to the specific device
22745  data sheet for availability.
22746 */
22747 
22748 void
22750  PORTS_MODULE_ID index ,
22751  PORTS_CHANNEL channel ,
22752  PORTS_BIT_POS bitPos ) ;
22753 // *****************************************************************************
22754 /* Function:
22755  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22756  PORTS_CHANNEL channel,
22757  PORTS_BIT_POS bitPos )
22758  Summary:
22759  Sets the selected digital pin/latch.
22760  <p><b>Implementation:</b> Dynamic</p>
22761  Description:
22762  This function sets the selected digital pin/latch.
22763  Preconditions:
22764  None.
22765  Parameters:
22766  index - Identifier for the device instance to be configured
22767  channel - Identifier for the PORT channel: A, B, C, etc.
22768  bitPos - Possible values of PORTS_BIT_POS
22769  Returns:
22770  None.
22771  Example:
22772  <code>
22773  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22774  // application developer.
22775  // MY_PINNUM - PORTS_PIN_10
22776  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22777  </code>
22778  Remarks:
22779  Not all features are available on all devices. Refer to the specific device
22780  data sheet for availability.
22781 */
22782 
22783 void
22785  PORTS_MODULE_ID index ,
22786  PORTS_CHANNEL channel ,
22787  PORTS_BIT_POS bitPos ) ;
22788 // *****************************************************************************
22789 /* Function:
22790  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22791  PORTS_CHANNEL channel,
22792  PORTS_BIT_POS bitPos )
22793  Summary:
22794  Clears the selected digital pin.
22795  <p><b>Implementation:</b> Dynamic</p>
22796  Description:
22797  This function clears the selected digital pin.
22798  Preconditions:
22799  None.
22800  Parameters:
22801  index - Identifier for the device instance to be configured
22802  channel - Identifier for the PORT channel: A, B, C, etc.
22803  bitPos - Possible values of PORTS_BIT_POS
22804  Returns:
22805  None.
22806  Example:
22807  <code>
22808  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22809  // application developer.
22810  // MY_PINNUM - PORTS_IO_PIN_10
22811  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22812  </code>
22813  Remarks:
22814  Not all features are available on all devices. Refer to the specific device
22815  data sheet for availability.
22816 */
22817 
22818 void
22820  PORTS_MODULE_ID index ,
22821  PORTS_CHANNEL channel ,
22822  PORTS_BIT_POS bitPos ) ;
22823 // *****************************************************************************
22824 /* Function:
22825  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22826  SYS_PORTS_PIN_DIRECTION pinDir,
22827  PORTS_CHANNEL channel,
22828  PORTS_BIT_POS bitPos )
22829  Summary:
22830  Enables the direction for the selected pin.
22831  <p><b>Implementation:</b> Dynamic</p>
22832  Description:
22833  This function enables the direction for the selected pin.
22834  Preconditions:
22835  None.
22836  Parameters:
22837  index - Identifier for the device instance to be configured
22838  pinDir - Pin direction
22839  channel - Identifier for the PORT channel: A, B, C, etc.
22840  bitPos - Possible values of PORTS_BIT_POS
22841  Returns:
22842  None.
22843  Example:
22844  <code>
22845  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22846  // application developer.
22847  // MY_PINNUM - PORTS_PIN_10
22848  SYS_PORTS_PIN_DIRECTION pinDir;
22849  pinDir = SYS_PORTS_DIRECTION_INPUT;
22850  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22851  </code>
22852  Remarks:
22853  Not all features are available on all devices. Refer to the specific device
22854  data sheet for availability.
22855 */
22856 
22857 void
22859  PORTS_MODULE_ID index ,
22860  SYS_PORTS_PIN_DIRECTION pinDir ,
22861  PORTS_CHANNEL channel ,
22862  PORTS_BIT_POS bitPos ) ;
22863 // *****************************************************************************
22864 /* Function:
22865  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22866  PORTS_CHANNEL channel,
22867  PORTS_BIT_POS bitPos )
22868  Summary:
22869  Enables the open-drain functionality for the selected pin.
22870  <p><b>Implementation:</b> Dynamic</p>
22871  Description:
22872  This function enables the open-drain functionality for the selected pin.
22873  Preconditions:
22874  None.
22875  Parameters:
22876  index - Identifier for the device instance to be configured
22877  channel - Identifier for the PORT channel: A, B, C, etc.
22878  bitPos - Possible values of PORTS_BIT_POS
22879  Returns:
22880  None.
22881  Example:
22882  <code>
22883  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22884  // application developer.
22885  // MY_PINNUM - PORTS_PIN_10
22886  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22887  </code>
22888  Remarks:
22889  Not all features are available on all devices. Refer to the specific device
22890  data sheet for availability.
22891 */
22892 
22893 void
22895  PORTS_MODULE_ID index ,
22896  PORTS_CHANNEL channel ,
22897  PORTS_BIT_POS bitPos ) ;
22898 // *****************************************************************************
22899 /* Function:
22900  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22901  PORTS_CHANNEL channel,
22902  PORTS_BIT_POS bitPos )
22903  Summary:
22904  Disables the open-drain functionality for the selected pin.
22905  <p><b>Implementation:</b> Dynamic</p>
22906  Description:
22907  This function disables the open-drain functionality for the selected pin.
22908  Preconditions:
22909  None.
22910  Parameters:
22911  index - Identifier for the device instance to be configured
22912  channel - Identifier for the PORT channel: A, B, C, etc.
22913  bitPos - Possible values of PORTS_BIT_POS
22914  Returns:
22915  None.
22916  Example:
22917  <code>
22918  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22919  // application developer.
22920  // MY_PINNUM - PORTS_PIN_10
22921  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22922  </code>
22923  Remarks:
22924  Not all features are available on all devices. Refer to the specific device
22925  data sheet for availability.
22926 */
22927 
22928 void
22930  PORTS_MODULE_ID index ,
22931  PORTS_CHANNEL channel ,
22932  PORTS_BIT_POS bitPos ) ;
22933 // *****************************************************************************
22934 /* Function:
22935  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22936  PORTS_CHANNEL channel,
22937  PORTS_BIT_POS bitPos )
22938  Summary:
22939  Enables the pull-up functionality for the selected pin.
22940  <p><b>Implementation:</b> Dynamic</p>
22941  Description:
22942  This function enables the pull-up functionality for the selected pin.
22943  Preconditions:
22944  None.
22945  Parameters:
22946  index - Identifier for the device instance to be configured
22947  channel - Identifier for the PORT channel: A, B, C, etc.
22948  bitPos - Possible values of PORTS_BIT_POS
22949  Returns:
22950  None.
22951  Example:
22952  <code>
22953  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22954  // application developer.
22955  // MY_PINNUM - PORTS_PIN_10
22956  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22957  </code>
22958  Remarks:
22959  Not all features are available on all devices. Refer to the specific device
22960  data sheet for availability.
22961 */
22962 
22963 void
22965  PORTS_MODULE_ID index ,
22966  PORTS_CHANNEL channel ,
22967  PORTS_BIT_POS bitPos ) ;
22968 // *****************************************************************************
22969 /* Function:
22970  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22971  PORTS_CHANNEL channel,
22972  PORTS_BIT_POS bitPos )
22973  Summary:
22974  Disables the pull-up functionality for the selected pin.
22975  <p><b>Implementation:</b> Dynamic</p>
22976  Description:
22977  This function disables the pull-up functionality for the selected pin.
22978  Preconditions:
22979  None.
22980  Parameters:
22981  index - Identifier for the device instance to be configured
22982  channel - Identifier for the PORT channel: A, B, C, etc.
22983  bitPos - Possible values of PORTS_BIT_POS
22984  Returns:
22985  None.
22986  Example:
22987  <code>
22988  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22989  // application developer.
22990  // MY_PINNUM - PORTS_PIN_10
22991  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22992  </code>
22993  Remarks:
22994  Not all features are available on all devices. Refer to the specific device
22995  data sheet for availability.
22996 */
22997 
22998 void
23000  PORTS_MODULE_ID index ,
23001  PORTS_CHANNEL channel ,
23002  PORTS_BIT_POS bitPos ) ;
23003 // *****************************************************************************
23004 /* Function:
23005  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23006  PORTS_CHANNEL channel,
23007  PORTS_BIT_POS bitPos )
23008  Summary:
23009  Enables the pull-down functionality for the selected pin.
23010  <p><b>Implementation:</b> Dynamic</p>
23011  Description:
23012  This function enables the pull-down functionality for the selected pin.
23013  Preconditions:
23014  None.
23015  Parameters:
23016  index - Identifier for the device instance to be configured
23017  channel - Identifier for the PORT channel: A, B, C, etc.
23018  bitPos - Possible values of PORTS_BIT_POS
23019  Returns:
23020  None.
23021  Example:
23022  <code>
23023  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23024  // application developer.
23025  // MY_PINNUM - PORTS_PIN_10
23026  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23027  </code>
23028  Remarks:
23029  Not all features are available on all devices. Refer to the specific device
23030  data sheet for availability.
23031 */
23032 
23033 void
23035  PORTS_MODULE_ID index ,
23036  PORTS_CHANNEL channel ,
23037  PORTS_BIT_POS bitPos ) ;
23038 // *****************************************************************************
23039 /* Function:
23040  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23041  PORTS_CHANNEL channel,
23042  PORTS_BIT_POS bitPos )
23043  Summary:
23044  Disables the pull-down functionality for the selected pin.
23045  <p><b>Implementation:</b> Dynamic</p>
23046  Description:
23047  This function disables the pull-down functionality for the selected pin.
23048  Preconditions:
23049  None.
23050  Parameters:
23051  index - Identifier for the device instance to be configured
23052  channel - Identifier for the PORT channel: A, B, C, etc.
23053  bitPos - Possible values of PORTS_BIT_POS
23054  Returns:
23055  None.
23056  Example:
23057  <code>
23058  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23059  // application developer.
23060  // MY_PINNUM - PORTS_PIN_10
23061  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23062  </code>
23063  Remarks:
23064  Not all features are available on all devices. Refer to the specific device
23065  data sheet for availability.
23066 */
23067 
23068 void
23070  PORTS_MODULE_ID index ,
23071  PORTS_CHANNEL channel ,
23072  PORTS_BIT_POS bitPos ) ;
23073 //******************************************************************************
23074 /* Function:
23075  void SYS_PORTS_InterruptEnable
23076  (
23077  PORTS_MODULE_ID index,
23078  PORTS_CHANNEL channel,
23079  PORTS_BIT_POS bitPos,
23080  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23081  )
23082  Summary:
23083  Enables the selected interrupt for the selected port pin.
23084  Description:
23085  This function enables the selected interrupt for the selected port pin.
23086  Preconditions:
23087  Select the pull-up or pull-down as required.
23088  Parameters:
23089  index - Identifier for the device instance to be configured
23090  channel - Identifier for the PORT channel: A, B, C, etc.
23091  bitPos - Possible values of PORTS_BIT_POS
23092  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23093  Returns:
23094  None.
23095  Example:
23096  <code>
23097  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23098  </code>
23099  Remarks:
23100  None.
23101 */
23102 
23103 void
23105  PORTS_MODULE_ID index ,
23106  PORTS_CHANNEL channel ,
23107  PORTS_BIT_POS bitPos ,
23108  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23109 //DOM-IGNORE-BEGIN
23110 //DOM-IGNORE-END
23111  //SYS_PORTS_H
23112 /*******************************************************************************
23113  End of File
23114 */
23115 
23116 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23117 /* CLOSE_FILE Include File */
23118 
23119 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23120 /*******************************************************************************
23121  SPI Driver Interface
23122  Company:
23123  Microchip Technology Inc.
23124  File Name:
23125  drv_spi.h
23126  Summary:
23127  SPI device driver interface file.
23128  Description:
23129  The SPI driver provides a simple interface to manage the SPI module.
23130  This file defines the interface definitions and prototypes for the SPI driver.
23131 *******************************************************************************/
23132 //DOM-IGNORE-BEGIN
23133 /*******************************************************************************
23134 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23135 Microchip licenses to you the right to use, modify, copy and distribute
23136 Software only when embedded on a Microchip microcontroller or digital signal
23137 controller that is integrated into your product or third party product
23138 (pursuant to the sublicense terms in the accompanying license agreement).
23139 You should refer to the license agreement accompanying this Software for
23140 additional information regarding your rights and obligations.
23141 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23142 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23143 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23144 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23145 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23146 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23147 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23148 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23149 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23150 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23151 *******************************************************************************/
23152 //DOM-IGNORE-END
23153 #ifndef _DRV_SPI_H
23154 #define _DRV_SPI_H
23155 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23156 /*******************************************************************************
23157  SPI Driver Interface
23158  Company:
23159  Microchip Technology Inc.
23160  File Name:
23161  drv_spi_definitions.h
23162  Summary:
23163  SPI device driver interface file.
23164  Description:
23165  The SPI driver provides a simple interface to manage the SPI module.
23166  This file defines the interface definitions and prototypes for the SPI
23167  driver.
23168 *******************************************************************************/
23169 //DOM-IGNORE-BEGIN
23170 /*******************************************************************************
23171 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23172 Microchip licenses to you the right to use, modify, copy and distribute
23173 Software only when embedded on a Microchip microcontroller or digital signal
23174 controller that is integrated into your product or third party product
23175 (pursuant to the sublicense terms in the accompanying license agreement).
23176 You should refer to the license agreement accompanying this Software for
23177 additional information regarding your rights and obligations.
23178 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23179 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23180 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23181 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23182 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23183 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23184 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23185 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23186 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23187 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23188 *******************************************************************************/
23189 //DOM-IGNORE-END
23190 #ifndef _DRV_SPI_DEFINITIONS_H
23191 #define _DRV_SPI_DEFINITIONS_H
23192 // *****************************************************************************
23193 // *****************************************************************************
23194 // Section: Data Types
23195 // *****************************************************************************
23196 // *****************************************************************************
23197 #include <stdint.h>
23198 #include <stdbool.h>
23199 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23200 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23201 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23202 /*******************************************************************************
23203  SPI Peripheral Library Interface Header
23204  Company:
23205  Microchip Technology Inc.
23206  File Name:
23207  plib_spi.h
23208  Summary:
23209  SPI Peripheral Library Interface Header for common definitions.
23210  Description:
23211  This header file contains the function prototypes and definitions of
23212  the data types and constants that make up the interface to the SPI
23213  PLIB.
23214  *******************************************************************************/
23215 // DOM-IGNORE-BEGIN
23216 /*******************************************************************************
23217 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23218 Microchip licenses to you the right to use, modify, copy and distribute
23219 Software only when embedded on a Microchip microcontroller or digital signal
23220 controller that is integrated into your product or third party product
23221 (pursuant to the sublicense terms in the accompanying license agreement).
23222 You should refer to the license agreement accompanying this Software for
23223 additional information regarding your rights and obligations.
23224 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23225 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23226 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23227 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23228 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23229 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23230 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23231 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23232 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23233 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23234  *******************************************************************************/
23235 // DOM-IGNORE-END
23236 #ifndef _PLIB_SPI_H
23237 #define _PLIB_SPI_H
23238 // DOM-IGNORE-BEGIN
23239 // DOM-IGNORE-END
23240 // *****************************************************************************
23241 // *****************************************************************************
23242 // Section: Included Files (continued at end of file)
23243 // *****************************************************************************
23244 // *****************************************************************************
23245 /* This section lists the other files that are included in this file. However,
23246  please see the end of the file for additional implementation header files
23247  that are also included.
23248  */
23249 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23250 //DOM-IGNORE-BEGIN
23251 /*******************************************************************************
23252 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23253 Microchip licenses to you the right to use, modify, copy and distribute
23254 Software only when embedded on a Microchip microcontroller or digital signal
23255 controller that is integrated into your product or third party product
23256 (pursuant to the sublicense terms in the accompanying license agreement).
23257 You should refer to the license agreement accompanying this Software for
23258 additional information regarding your rights and obligations.
23259 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23260 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23261 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23262 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23263 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23264 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23265 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23266 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23267 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23268 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23269  *******************************************************************************/
23270 //DOM-IGNORE-END
23271 #ifndef _PLIB_SPI_PROCESSOR_H
23272 #define _PLIB_SPI_PROCESSOR_H
23273 #error "Can't find header"
23274 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23275 /* CLOSE_FILE Include File */
23276 
23277 // *****************************************************************************
23278 // *****************************************************************************
23279 // Section: Constants & Data Types
23280 // *****************************************************************************
23281 // *****************************************************************************
23282 // *****************************************************************************
23283 // *****************************************************************************
23284 // Section: SPI Peripheral Library Interface Routines
23285 // *****************************************************************************
23286 // *****************************************************************************
23287 //******************************************************************************
23288 /* Function:
23289  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23290  Summary:
23291  Enables the SPI module.
23292  Description:
23293  This function enables the SPI module.
23294  This operation is atomic.
23295  Precondition:
23296  None.
23297  Parameters:
23298  index - Identifier for the device instance to be configured
23299  Returns:
23300  None.
23301  Example:
23302  <code>
23303  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23304  // application developer.
23305  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23306  </code>
23307  Remarks:
23308  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23309  before use.
23310  This function implements an operation of the enable control feature. This
23311  feature may not be available on all devices. Please refer to the specific
23312  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23313  in your application to automatically determine whether this feature is available.
23314  */
23315 
23316 void
23317  PLIB_SPI_Enable (
23318  SPI_MODULE_ID index ) ;
23319 //******************************************************************************
23320 /* Function:
23321  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23322  Summary:
23323  Disables the SPI module.
23324  Description:
23325  This function disables the SPI module.
23326  This operation is atomic.
23327  Precondition:
23328  None.
23329  Parameters:
23330  index - Identifier for the device instance to be configured
23331  Returns:
23332  None.
23333  Example:
23334  <code>
23335  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23336  // application developer.
23337  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23338  </code>
23339  Remarks:
23340  This function implements an operation of the enable control feature. This
23341  feature may not be available on all devices. Please refer to the specific
23342  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23343  in your application to automatically determine whether this feature is available.
23344  */
23345 
23346 void
23348  SPI_MODULE_ID index ) ;
23349 //******************************************************************************
23350 /* Function:
23351  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23352  Summary:
23353  Discontinues module operation when the device enters Idle mode.
23354  Description:
23355  This function sets up the SPI module such that module operation is disabled
23356  when the device enters Idle mode.
23357  This operation is atomic.
23358  Precondition:
23359  None.
23360  Parameters:
23361  index - Identifier for the device instance to be configured
23362  Returns:
23363  None.
23364  Example:
23365  <code>
23366  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23367  // application developer.
23368  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23369  </code>
23370  Remarks:
23371  This function implements an operation of the stop in idle control feature.
23372  This feature may not be available on all devices. Please refer to the
23373  specific device data sheet to determine availability or use
23374  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23375  determine if this feature is available.
23376  */
23377 
23378 void
23380  SPI_MODULE_ID index ) ;
23381 //******************************************************************************
23382 /* Function:
23383  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23384  Summary:
23385  Continues module operation when the device enters Idle mode.
23386  Description:
23387  This function sets up the SPI module such that module operation is continued
23388  when the device enters Idle mode.
23389  This operation is atomic.
23390  Precondition:
23391  None.
23392  Parameters:
23393  index - Identifier for the device instance to be configured
23394  Returns:
23395  None.
23396  Example:
23397  <code>
23398  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23399  // application developer.
23400  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23401  </code>
23402  Remarks:
23403  This function implements an operation of the stop in idle control feature.
23404  This feature may not be available on all devices. Please refer to the
23405  specific device data sheet to determine availability or use
23406  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23407  this feature is available.
23408  */
23409 
23410 void
23412  SPI_MODULE_ID index ) ;
23413 //******************************************************************************
23414 /* Function:
23415  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23416  Summary:
23417  Returns the current status of the SPI receiver overflow.
23418  Description:
23419  This function returns the current status of the SPI receiver overflow.
23420  This operation is atomic.
23421  Precondition:
23422  None.
23423  Parameters:
23424  index - Identifier for the device instance to be configured
23425  Returns:
23426  SPI receiver overflow status:
23427  - true - A new byte/word is completely received and discarded.
23428  The user software has not read the previous data in
23429  the SPI buffer register.
23430  - false - No Overflow has occurred
23431  Example:
23432  <code>
23433  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23434  // application developer.
23435  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23436  </code>
23437  Remarks:
23438  This function implements an operation of the receiver overflow status feature.
23439  This feature may not be available on all devices. Please refer to the
23440  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23441  in your application to automatically determine whether this feature is available.
23442  */
23443 
23444 bool
23446  SPI_MODULE_ID index ) ;
23447 //******************************************************************************
23448 /* Function:
23449  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23450  Summary:
23451  Clears the SPI receive overflow flag.
23452  Description:
23453  This function clears the SPI receive overflow flag.
23454  This operation is atomic.
23455  Precondition:
23456  None.
23457  Parameters:
23458  index - Identifier for the device instance to be configured
23459  Returns:
23460  None.
23461  Example:
23462  <code>
23463  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23464  // application developer.
23465  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23466  </code>
23467  Remarks:
23468  This function implements an operation of the receiver overflow status feature.
23469  This feature may not be available on all devices. Please refer to the
23470  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23471  in your application to automatically determine whether this feature is available.
23472  */
23473 
23474 void
23476  SPI_MODULE_ID index ) ;
23477 //******************************************************************************
23478 /* Function:
23479  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23480  Summary:
23481  Returns the current transmit buffer status of the SPI module.
23482  Description:
23483  This function returns the current transmit buffer status of the SPI module.
23484  This operation is atomic.
23485  Precondition:
23486  None.
23487  Parameters:
23488  index - Identifier for the device instance to be configured
23489  Returns:
23490  - true - Transmit not yet started, transmit buffer is full
23491  - false - Transmit started, transmit buffer is empty/not full
23492  Example:
23493  <code>
23494  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23495  // application developer.
23496  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23497  </code>
23498  Remarks:
23499  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23500  occur, loading the transmit buffer. Automatically cleared in hardware when
23501  the SPI module transfers data from the transmit buffer to the shift register.
23502  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23503  occur, loading the last available buffer. Automatically cleared in hardware
23504  when the buffer is available for writing.
23505  This function implements an operation of the transmit buffer status feature.
23506  This feature may not be available on all devices. Please refer to the
23507  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23508  in your application to automatically determine whether this feature is available.
23509  */
23510 
23511 bool
23513  SPI_MODULE_ID index ) ;
23514 //******************************************************************************
23515 /* Function:
23516  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23517  Summary:
23518  Returns the current status of the SPI receive buffer.
23519  Description:
23520  This function returns the current status of the SPI receive buffer.
23521  This operation is atomic.
23522  Precondition:
23523  None.
23524  Parameters:
23525  index - Identifier for the device instance to be configured
23526  Returns:
23527  Receiver Buffer Full Status:
23528  - true - Receive complete, receive buffer is full
23529  - false - Receive is not complete, receive buffer is empty
23530  Example:
23531  <code>
23532  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23533  // application developer.
23534  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23535  </code>
23536  Remarks:
23537  In Standard Buffer mode - automatically set in hardware when the SPI module
23538  transfers data from the shift register to the receive buffer. Automatically
23539  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23540  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23541  transfers data from the shift register to the receive buffer, filling the
23542  last unread buffer. Automatically cleared in hardware when a buffer is available
23543  for a transfer from the shift register.
23544  This function implements an operation of the receiver buffer status feature.
23545  This feature may not be available on all devices. Please refer to the
23546  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23547  in your application to automatically determine whether this feature is available.
23548  */
23549 
23550 bool
23552  SPI_MODULE_ID index ) ;
23553 //******************************************************************************
23554 /* Function:
23555  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23556  Summary:
23557  Enables the selected SPI pins.
23558  Description:
23559  This function enables the selected SPI pins.
23560  Precondition:
23561  None.
23562  Parameters:
23563  index - Identifier for the device instance to be configured
23564  pin - One of the SPI_PIN enumeration values as the SPI pin
23565  Returns:
23566  None.
23567  Example:
23568  <code>
23569  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23570  // application developer.
23571  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23572  </code>
23573  Remarks:
23574  This function implements an operation of the pin control feature.
23575  This feature may not be available on all devices. Please refer to the
23576  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23577  in your application to automatically determine whether this feature is available.
23578  */
23579 
23580 void
23582  SPI_MODULE_ID index ,
23583  SPI_PIN pin ) ;
23584 //******************************************************************************
23585 /* Function:
23586  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23587  Summary:
23588  Enables the selected SPI pins.
23589  Description:
23590  This function enables the selected SPI pins.
23591  Precondition:
23592  None.
23593  Parameters:
23594  index - Identifier for the device instance to be configured
23595  pin - One of the SPI_PIN enumeration values as the SPI pin
23596  Returns:
23597  None.
23598  Example:
23599  <code>
23600  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23601  // application developer.
23602  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23603  </code>
23604  Remarks:
23605  This function implements an operation of the pin control feature.
23606  This feature may not be available on all devices. Please refer to the
23607  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23608  in your application to automatically determine whether this feature is available.
23609  */
23610 
23611 void
23613  SPI_MODULE_ID index ,
23614  SPI_PIN pin ) ;
23615 //******************************************************************************
23616 /* Function:
23617  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23618  SPI_COMMUNICATION_WIDTH width )
23619  Summary:
23620  Selects the data width for the SPI communication.
23621  Description:
23622  This function selects the data width for the SPI communication.
23623  This operation is atomic.
23624  Precondition:
23625  None.
23626  Parameters:
23627  index - Identifier for the device instance to be configured
23628  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23629  SPI buffer width
23630  Returns:
23631  None.
23632  Example:
23633  <code>
23634  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23635  // application developer.
23636  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23637  </code>
23638  Remarks:
23639  This function implements an operation of the communication width feature.
23640  This feature may not be available on all devices. Please refer to the
23641  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23642  in your application to automatically determine whether this feature is available.
23643  */
23644 
23645 void
23647  SPI_MODULE_ID index ,
23648  SPI_COMMUNICATION_WIDTH width ) ;
23649 //******************************************************************************
23650 /* Function:
23651  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23652  SPI_AUDIO_COMMUNICATION_WIDTH width )
23653  Summary:
23654  Selects the data width for the SPI audio communication.
23655  Description:
23656  This function selects the data width for the SPI audio communication.
23657  This operation is atomic.
23658  Precondition:
23659  None.
23660  Parameters:
23661  index - Identifier for the device instance to be configured
23662  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23663  SPI buffer width
23664  Returns:
23665  None.
23666  Example:
23667  <code>
23668  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23669  // application developer.
23670  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23671  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23672  </code>
23673  Remarks:
23674  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23675  This function implements an operation of the audio communication width feature.
23676  This feature may not be available on all devices. Please refer to the
23677  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23678  in your application to automatically determine whether this feature is available.
23679  */
23680 
23681 void
23683  SPI_MODULE_ID index ,
23684  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23685 //******************************************************************************
23686 /* Function:
23687  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23688  SPI_INPUT_SAMPLING_PHASE phase)
23689  Summary:
23690  Selects the SPI data input sample phase.
23691  Description:
23692  This function selects the input sampling phase in Master mode.
23693  Precondition:
23694  None.
23695  Parameters:
23696  index - Identifier for the device instance to be configured
23697  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23698  sampling phase
23699  Returns:
23700  None.
23701  Example:
23702  <code>
23703  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23704  // application developer.
23705  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23706  </code>
23707  Remarks:
23708  This function implements an operation of the input sample phase feature.
23709  This feature may not be available on all devices. Please refer to the
23710  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23711  in your application to automatically determine whether this feature is available.
23712  */
23713 
23714 void
23716  SPI_MODULE_ID index ,
23717  SPI_INPUT_SAMPLING_PHASE phase ) ;
23718 //******************************************************************************
23719 /* Function:
23720  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23721  SPI_OUTPUT_DATA_PHASE data)
23722  Summary:
23723  Selects serial output data change.
23724  Description:
23725  This function selects serial output data change.
23726  Precondition:
23727  None.
23728  Parameters:
23729  index - Identifier for the device instance to be configured
23730  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23731  SPI serial output data change
23732  Returns:
23733  None.
23734  Example:
23735  <code>
23736  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23737  // application developer.
23738  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23739  </code>
23740  Remarks:
23741  This function implements an operation of the output data phase feature.
23742  This feature may not be available on all devices. Please refer to the
23743  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23744  in your application to automatically determine whether this feature is available.
23745  */
23746 
23747 void
23749  SPI_MODULE_ID index ,
23750  SPI_OUTPUT_DATA_PHASE phase ) ;
23751 //******************************************************************************
23752 /* Function:
23753  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23754  SPI_CLOCK_POLARITY polarity)
23755  Summary:
23756  Enables clock polarity.
23757  Description:
23758  This function enables clock polarity.
23759  Precondition:
23760  None.
23761  Parameters:
23762  index - Identifier for the device instance to be configured
23763  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23764  Returns:
23765  None.
23766  Example:
23767  <code>
23768  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23769  // application developer.
23770  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23771  </code>
23772  Remarks:
23773  This function implements an operation of the clock polarity feature.
23774  This feature may not be available on all devices. Please refer to the
23775  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23776  in your application to automatically determine whether this feature is available.
23777  */
23778 
23779 void
23781  SPI_MODULE_ID index ,
23782  SPI_CLOCK_POLARITY polarity ) ;
23783 //******************************************************************************
23784 /* Function:
23785  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23786  Summary:
23787  Enables the SPI in Master mode.
23788  Description:
23789  This function enables the SPI in Master mode.
23790  This operation is atomic.
23791  Precondition:
23792  None.
23793  Parameters:
23794  index - Identifier for the device instance to be configured
23795  Returns:
23796  None.
23797  Example:
23798  <code>
23799  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23800  // application developer.
23801  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23802  </code>
23803  Remarks:
23804  This function implements an operation of the master enable control feature.
23805  This feature may not be available on all devices. Please refer to the
23806  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23807  in your application to automatically determine whether this feature is available.
23808  */
23809 
23810 void
23812  SPI_MODULE_ID index ) ;
23813 //******************************************************************************
23814 /* Function:
23815  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23816  Summary:
23817  Enables the SPI in Slave mode.
23818  Description:
23819  This function enables the SPI in Slave mode.
23820  This operation is atomic.
23821  Precondition:
23822  None.
23823  Parameters:
23824  index - Identifier for the device instance to be configured
23825  Returns:
23826  None.
23827  Example:
23828  <code>
23829  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23830  // application developer.
23831  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23832  </code>
23833  Remarks:
23834  This function implements an operation of the master enable control feature.
23835  This feature may not be available on all devices. Please refer to the
23836  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23837  in your application to automatically determine whether this feature is available.
23838  */
23839 
23840 void
23842  SPI_MODULE_ID index ) ;
23843 //******************************************************************************
23844 /* Function:
23845  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23846  uint32_t baudRate )
23847  Summary:
23848  Sets the baud rate to the desired value.
23849  Description:
23850  This function sets the baud rate to the desired value.
23851  Precondition:
23852  None.
23853  Parameters:
23854  index - Identifier for the device instance to be configured
23855  clockFrequency - Clock frequency
23856  baudrate - Baud rate value
23857  Returns:
23858  None.
23859  Example:
23860  <code>
23861  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23862  // application developer.
23863  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23864  </code>
23865  Remarks:
23866  Setting a new baud rate value causes the baud rate timer to reset.
23867  This ensures that the baud rate timer does not have to overflow before
23868  outputting the new baud rate.
23869  If the system clock is changed during an active receive operation, a
23870  receive error or data loss may result. To avoid this issue, verify that
23871  no receptions are in progress before changing the system clock.
23872  This function implements an operation of the baud rate set feature.
23873  This feature may not be available on all devices. Please refer to the
23874  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23875  in your application to automatically determine whether this feature is available.
23876  */
23877 
23878 void
23880  SPI_MODULE_ID index ,
23881  uint32_t clockFrequency ,
23882  uint32_t baudRate ) ;
23883 //******************************************************************************
23884 /* Function:
23885  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23886  Summary:
23887  Returns the current SPI module activity status.
23888  Description:
23889  This function returns the current SPI module activity status.
23890  This operation is atomic.
23891  Precondition:
23892  None.
23893  Parameters:
23894  index - Identifier for the device instance to be configured
23895  Returns:
23896  - true - SPI module is currently busy with some transactions
23897  - false - SPI module is currently idle
23898  Example:
23899  <code>
23900  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23901  // application developer.
23902  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23903  </code>
23904  Remarks:
23905  This function implements an operation of the bus status feature.
23906  This feature may not be available on all devices. Please refer to the
23907  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23908  in your application to automatically determine whether this feature is available.
23909  */
23910 
23911 bool
23912  PLIB_SPI_IsBusy (
23913  SPI_MODULE_ID index ) ;
23914 //******************************************************************************
23915 /* Function:
23916  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23917  Summary:
23918  Returns the current status of the receive (RX) FIFO sign-extended data.
23919  Description:
23920  This function returns the current status of the receive (RX) FIFO
23921  sign-extended data.
23922  This operation is atomic.
23923  Precondition:
23924  None.
23925  Parameters:
23926  index - Identifier for the device instance to be configured
23927  Returns:
23928  - true - Data from RX FIFO is sign-extended
23929  - false - Data from RX FIFO is not sign-extended
23930  Example:
23931  <code>
23932  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23933  // application developer.
23934  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23935  </code>
23936  Remarks:
23937  This function implements an operation of the data sign feature.
23938  This feature may not be available on all devices. Please refer to the
23939  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23940  in your application to automatically determine whether this feature is available.
23941  */
23942 
23943 bool
23945  SPI_MODULE_ID index ) ;
23946 //******************************************************************************
23947 /* Function:
23948  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23949  Summary:
23950  Enables Master mode slave select.
23951  Description:
23952  This function enables Master mode slave select.
23953  This operation is atomic.
23954  Precondition:
23955  None.
23956  Parameters:
23957  index - Identifier for the device instance to be configured
23958  Returns:
23959  None.
23960  Example:
23961  <code>
23962  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23963  // application developer.
23964  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23965  </code>
23966  Remarks:
23967  This feature does not support Framed SPI mode.
23968  This function implements an operation of the Master mode slave select feature.
23969  This feature may not be available on all devices. Please refer to the
23970  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23971  in your application to automatically determine whether this feature is available.
23972 
23973  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23974  */
23975 
23976 void
23978  SPI_MODULE_ID index ) ;
23979 //******************************************************************************
23980 /* Function:
23981  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23982  Summary:
23983  Disables Master mode slave select.
23984  Description:
23985  This function disables Master mode slave select.
23986  This operation is atomic.
23987  Precondition:
23988  None.
23989  Parameters:
23990  index - Identifier for the device instance to be configured
23991  Returns:
23992  None.
23993  Example:
23994  <code>
23995  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23996  // application developer.
23997  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
23998  </code>
23999  Remarks:
24000  This feature does not support Framed SPI mode.
24001  This function implements an operation of the slave select feature.
24002  This feature may not be available on all devices. Please refer to the
24003  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24004  in your application to automatically determine whether this feature is available.
24005 
24006  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24007  */
24008 
24009 void
24011  SPI_MODULE_ID index ) ;
24012 //******************************************************************************
24013 /* Function:
24014  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24015  Summary:
24016  Returns the current status of the transmit underrun.
24017  Description:
24018  This function returns the current status of the transmit underrun.
24019  This operation is atomic.
24020  Precondition:
24021  None.
24022  Parameters:
24023  index - Identifier for the device instance to be configured
24024  Returns:
24025  - true - Transmit buffer has encountered an underrun condition
24026  - false - Transmit buffer run has not encountered an underrun condition
24027  Example:
24028  <code>
24029  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24030  // application developer.
24031  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24032  </code>
24033  Remarks:
24034  Valid in Framed Sync mode.
24035  This function implements an operation of the transmit underrun status feature.
24036  This feature may not be available on all devices. Please refer to the
24037  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24038  in your application to automatically determine whether this feature is available.
24039  */
24040 
24041 bool
24043  SPI_MODULE_ID index ) ;
24044 //******************************************************************************
24045 /* Function:
24046  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24047  Summary:
24048  Clears the SPI transmit underrun flag.
24049  Description:
24050  This function clears the SPI transmit underrun flag.
24051  This operation is atomic.
24052  Precondition:
24053  None.
24054  Parameters:
24055  index - Identifier for the device instance to be configured
24056  Returns:
24057  None.
24058  Example:
24059  <code>
24060  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24061  // application developer.
24062  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24063  </code>
24064  Remarks:
24065  This function implements an operation of the transmit underrun status feature.
24066  This feature may not be available on all devices. Please refer to the
24067  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24068  in your application to automatically determine whether this feature is available.
24069  */
24070 
24071 void
24073  SPI_MODULE_ID index ) ;
24074 //******************************************************************************
24075 /* Function:
24076  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24077  Summary:
24078  Returns the current status of the transmit buffer.
24079  Description:
24080  This function returns the current status of the transmit buffer.
24081  This operation is atomic.
24082  Precondition:
24083  None.
24084  Parameters:
24085  index - Identifier for the device instance to be configured
24086  Returns:
24087  - true - Transmit buffer is empty
24088  - false - Transmit buffer is not empty
24089  Example:
24090  <code>
24091  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24092  // application developer.
24093  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24094  </code>
24095  Remarks:
24096  This function implements an operation of the transmit buffer empty status feature.
24097  This feature may not be available on all devices. Please refer to the
24098  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24099  in your application to automatically determine whether this feature is available.
24100  */
24101 
24102 bool
24104  SPI_MODULE_ID index ) ;
24105 //******************************************************************************
24106 /* Function:
24107  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24108  Summary:
24109  Enables the SPI enhanced buffer.
24110  Description:
24111  This function enables the SPI enhanced buffer.
24112  This operation is atomic.
24113  Precondition:
24114  None.
24115  Parameters:
24116  index - Identifier for the device instance to be configured
24117  Returns:
24118  None.
24119  Example:
24120  <code>
24121  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24122  // application developer.
24123  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24124  </code>
24125  Remarks:
24126  This enables the enhanced buffer mode.
24127  This function implements an operation of the FIFO control feature.
24128  This feature may not be available on all devices. Please refer to the
24129  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24130  in your application to automatically determine whether this feature is available.
24131  */
24132 
24133 void
24135  SPI_MODULE_ID index ) ;
24136 //******************************************************************************
24137 /* Function:
24138  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24139  Summary:
24140  Disables the SPI enhanced buffer.
24141  Description:
24142  This function disables the SPI enhanced buffer.
24143  This operation is atomic.
24144  Precondition:
24145  None.
24146  Parameters:
24147  index - Identifier for the device instance to be configured
24148  Returns:
24149  None.
24150  Example:
24151  <code>
24152  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24153  // application developer.
24154  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24155  </code>
24156  Remarks:
24157  Enables the legacy standard single buffer mode.
24158  This function implements an operation of the FIFO control feature.
24159  This feature may not be available on all devices. Please refer to the
24160  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24161  in your application to automatically determine whether this feature is available.
24162  */
24163 
24164 void
24166  SPI_MODULE_ID index ) ;
24167 //******************************************************************************
24168 /* Function:
24169  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24170  Summary:
24171  Reads the SPI Buffer Element Count bits for either receive or transmit.
24172  Description:
24173  This function reads the number of SPI transfers pending for Master mode
24174  and the number of unread SPI transfers for Slave mode.
24175  Precondition:
24176  None.
24177  Parameters:
24178  index - Identifier for the device instance to be configured
24179  type - One of the SPI_FIFO_TYPE enumeration values
24180  Returns:
24181  CountValue - Buffer element count bits
24182  Example:
24183  <code>
24184  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24185  // application developer.
24186  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24187  </code>
24188  Remarks:
24189  Valid in Enhanced Buffer mode.
24190  This function implements an operation of the FIFO control feature.
24191  This feature may not be available on all devices. Please refer to the
24192  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24193  in your application to automatically determine whether this feature is available.
24194  */
24195 
24196 uint8_t
24198  SPI_MODULE_ID index ,
24199  SPI_FIFO_TYPE type ) ;
24200 //******************************************************************************
24201 /* Function:
24202  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24203  Summary:
24204  Returns the current status of the SPI shift register.
24205  Description:
24206  This function returns the current status of the SPI shift register.
24207  This operation is atomic.
24208  Precondition:
24209  None.
24210  Parameters:
24211  index - Identifier for the device instance to be configured
24212  Returns:
24213  - true - SPI shift register is empty and ready to send or receive
24214  - false - SPI shift register is not empty
24215  Example:
24216  <code>
24217  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24218  // application developer.
24219  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24220  </code>
24221  Remarks:
24222  Valid in Enhanced Buffer mode.
24223  This function implements an operation of the FIFO status feature.
24224  This feature may not be available on all devices. Please refer to the
24225  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24226  in your application to automatically determine whether this feature is available.
24227  */
24228 
24229 bool
24231  SPI_MODULE_ID index ) ;
24232 //******************************************************************************
24233 /* Function:
24234  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24235  Summary:
24236  Returns the current status of the SPI receive FIFO.
24237  Description:
24238  This function returns the current status of the SPI receive FIFO.
24239  This operation is atomic.
24240  Precondition:
24241  None.
24242  Parameters:
24243  index - Identifier for the device instance to be configured
24244  Returns:
24245  - true - Receive FIFO is empty
24246  - false - Receive FIFO is not empty
24247  Example:
24248  <code>
24249  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24250  // application developer.
24251  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24252  </code>
24253  Remarks:
24254  Valid in Enhanced Buffer mode.
24255  This function implements an operation of the FIFO status feature.
24256  This feature may not be available on all devices. Please refer to the
24257  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24258  in your application to automatically determine whether this feature is available.
24259  */
24260 
24261 bool
24263  SPI_MODULE_ID index ) ;
24264 //******************************************************************************
24265 /* Function:
24266  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24267  SPI_FIFO_INTERRUPT mode)
24268  Summary:
24269  Selects the SPI buffer interrupt mode.
24270  Description:
24271  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24272  Precondition:
24273  None.
24274  Parameters:
24275  index - Identifier for the device instance to be configured
24276  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24277  interrupt mode
24278  Returns:
24279  None.
24280  Example:
24281  <code>
24282  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24283  // application developer.
24284  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24285  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24286  </code>
24287  Remarks:
24288  Valid in Enhanced Buffer mode.
24289  This function implements an operation of the FIFO interrupt feature.
24290  This feature may not be available on all devices. Please refer to the
24291  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24292  in your application to automatically determine whether this feature is available.
24293  */
24294 
24295 void
24297  SPI_MODULE_ID index ,
24298  SPI_FIFO_INTERRUPT mode ) ;
24299 //******************************************************************************
24300 /* Function:
24301  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24302  Summary:
24303  Enables framed SPI support.
24304  Description:
24305  This function enables framed SPI support.
24306  This operation is atomic.
24307  Precondition:
24308  None.
24309  Parameters:
24310  index - Identifier for the device instance to be configured
24311  Returns:
24312  None.
24313  Example:
24314  <code>
24315  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24316  // application developer.
24317  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24318  </code>
24319  Remarks:
24320  This function implements an operation of the framed communication feature.
24321  This feature may not be available on all devices. Please refer to the
24322  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24323  in your application to automatically determine whether this feature is available.
24324  */
24325 
24326 void
24328  SPI_MODULE_ID index ) ;
24329 //******************************************************************************
24330 /* Function:
24331  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24332  Summary:
24333  Disables framed SPI support.
24334  Description:
24335  This function disables framed SPI support.
24336  This operation is atomic.
24337  Precondition:
24338  None.
24339  Parameters:
24340  index - Identifier for the device instance to be configured
24341  Returns:
24342  None.
24343  Example:
24344  <code>
24345  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24346  // application developer.
24347  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24348  </code>
24349  Remarks:
24350  This function implements an operation of the framed communication feature.
24351  This feature may not be available on all devices. Please refer to the
24352  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24353  in your application to automatically determine whether this feature is available.
24354  */
24355 
24356 void
24358  SPI_MODULE_ID index ) ;
24359 //******************************************************************************
24360 /* Function:
24361  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24362  SPI_FRAME_PULSE_DIRECTION direction)
24363  Summary:
24364  Selects the frame sync pulse direction.
24365  Description:
24366  This function selects the frame sync pulse direction.
24367  Precondition:
24368  None.
24369  Parameters:
24370  index - Identifier for the device instance to be configured
24371  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24372  as the SPI frame sync pulse polarity
24373  Returns:
24374  None.
24375  Example:
24376  <code>
24377  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24378  // application developer.
24379  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24380  </code>
24381  Remarks:
24382  This function implements an operation of the framed communication feature.
24383  This feature may not be available on all devices. Please refer to the
24384  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24385  in your application to automatically determine whether this feature is available.
24386  */
24387 
24388 void
24390  SPI_MODULE_ID index ,
24391  SPI_FRAME_PULSE_DIRECTION direction ) ;
24392 //******************************************************************************
24393 /* Function:
24394  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24395  SPI_FRAME_PULSE_POLARITY polarity)
24396  Summary:
24397  Selects the frame sync pulse polarity.
24398  Description:
24399  This function selects the frame sync pulse polarity.
24400  Precondition:
24401  None.
24402  Parameters:
24403  index - Identifier for the device instance to be configured
24404  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24405  sync pulse polarity
24406  Returns:
24407  None.
24408  Example:
24409  <code>
24410  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24411  // application developer.
24412  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24413  </code>
24414  Remarks:
24415  Available only for Frame mode.
24416  This function implements an operation of the framed communication feature.
24417  This feature may not be available on all devices. Please refer to the
24418  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24419  in your application to automatically determine whether this feature is available.
24420  */
24421 
24422 void
24424  SPI_MODULE_ID index ,
24425  SPI_FRAME_PULSE_POLARITY polarity ) ;
24426 //******************************************************************************
24427 /* Function:
24428  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24429  SPI_FRAME_PULSE_EDGE edge)
24430  Summary:
24431  Selects the frame sync pulse edge.
24432  Description:
24433  This function selects the frame sync pulse edge.
24434  Precondition:
24435  None.
24436  Parameters:
24437  index - Identifier for the device instance to be configured
24438  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24439  SPI frame sync pulse edge
24440  Returns:
24441  None.
24442  Example:
24443  <code>
24444  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24445  // application developer.
24446  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24447  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24448  </code>
24449  Remarks:
24450  This function implements an operation of the framed communication feature.
24451  This feature may not be available on all devices. Please refer to the
24452  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24453  in your application to automatically determine whether this feature is available.
24454  */
24455 
24456 void
24458  SPI_MODULE_ID index ,
24459  SPI_FRAME_PULSE_EDGE edge ) ;
24460 //******************************************************************************
24461 /* Function:
24462  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24463  SPI_FRAME_PULSE_WIDTH width)
24464  Summary:
24465  Sets the frame sync pulse width.
24466  Description:
24467  This function sets the frame sync pulse width.
24468  Precondition:
24469  None.
24470  Parameters:
24471  index - Identifier for the device instance to be configured
24472  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24473  frame sync pulse width.
24474  Returns:
24475  None.
24476  Example:
24477  <code>
24478  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24479  // application developer.
24480  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24481  </code>
24482  Remarks:
24483  Length of the word is dependent on the communication mode.
24484  This function implements an operation of the framed communication feature.
24485  This feature may not be available on all devices. Please refer to the
24486  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24487  in your application to automatically determine whether this feature is available.
24488  */
24489 
24490 void
24492  SPI_MODULE_ID index ,
24493  SPI_FRAME_PULSE_WIDTH width ) ;
24494 //******************************************************************************
24495 /* Function:
24496  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24497  SPI_FRAME_SYNC_PULSE pulse)
24498  Summary:
24499  Selects at which character the SPI frame sync pulse is generated.
24500  Description:
24501  This function selects at which character the SPI frame sync pulse is generated.
24502  Precondition:
24503  None.
24504  Parameters:
24505  index - Identifier for the device instance to be configured
24506  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24507  frame sync pulse count
24508  Returns:
24509  None.
24510  Example:
24511  <code>
24512  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24513  // application developer.
24514  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24515  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24516  </code>
24517  Remarks:
24518  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24519  This function implements an operation of the framed communication feature.
24520  This feature may not be available on all devices. Please refer to the
24521  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24522  in your application to automatically determine whether this feature is available.
24523  */
24524 
24525 void
24527  SPI_MODULE_ID index ,
24528  SPI_FRAME_SYNC_PULSE pulse ) ;
24529 //******************************************************************************
24530 /* Function:
24531  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24532  Summary:
24533  Returns the current status of the SPI frame error.
24534  Description:
24535  This function returns the current status of the SPI frame error.
24536  This operation is atomic.
24537  Precondition:
24538  None.
24539  Parameters:
24540  index - Identifier for the device instance to be configured
24541  Returns:
24542  - true - Frame error detected
24543  - false - No frame error detected
24544  Example:
24545  <code>
24546  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24547  // application developer.
24548  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24549  </code>
24550  Remarks:
24551  Valid only if Frame mode is enabled.
24552  This function implements an operation of the framed communication feature.
24553  This feature may not be available on all devices. Please refer to the
24554  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24555  in your application to automatically determine whether this feature is available.
24556  */
24557 
24558 bool
24560  SPI_MODULE_ID index ) ;
24561 //******************************************************************************
24562 /* Function:
24563  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24564  Summary:
24565  Clears the SPI frame error flag.
24566  Description:
24567  This function clears the SPI frame error flag.
24568  This operation is atomic.
24569  Precondition:
24570  None.
24571  Parameters:
24572  index - Identifier for the device instance to be configured
24573  Returns:
24574  None.
24575  Example:
24576  <code>
24577  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24578  // application developer.
24579  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24580  </code>
24581  Remarks:
24582  This function implements an operation of the frame error status feature.
24583  This feature may not be available on all devices. Please refer to the
24584  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24585  in your application to automatically determine whether this feature is available.
24586  */
24587 
24588 void
24590  SPI_MODULE_ID index ) ;
24591 //******************************************************************************
24592 /* Function:
24593  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24594  Summary:
24595  Clears the SPI receive buffer.
24596  Description:
24597  This function clears the SPI receive buffer.
24598  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24599  This operation is atomic.
24600  Precondition:
24601  None.
24602  Parameters:
24603  index - Identifier for the device instance to be configured
24604  Returns:
24605  None.
24606  Example:
24607  <code>
24608  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24609  // application developer.
24610  //This call will flush the receive buffer.
24611  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24612  </code>
24613  Remarks:
24614  This function implements an operation of the buffer control feature.
24615  This feature may not be available on all devices. Please refer to the
24616  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24617  in your application to automatically determine whether this feature is available.
24618  */
24619 
24620 void
24622  SPI_MODULE_ID index ) ;
24623 //******************************************************************************
24624 /* Function:
24625  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24626  Summary:
24627  Returns the SPI buffer value.
24628  Description:
24629  This function returns the SPI buffer value.
24630  This operation is atomic.
24631  Precondition:
24632  None.
24633  Parameters:
24634  index - Identifier for the device instance to be configured
24635  Returns:
24636  Reads the SPI buffer.
24637  Example:
24638  <code>
24639  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24640  // application developer.
24641  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24642  </code>
24643  Remarks:
24644  This function implements an operation of the buffer control feature.
24645  This feature may not be available on all devices. Please refer to the
24646  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24647  in your application to automatically determine whether this feature is available.
24648  */
24649 
24650 uint8_t
24652  SPI_MODULE_ID index ) ;
24653 //******************************************************************************
24654 /* Function:
24655  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24656  Summary:
24657  Returns 16-bit SPI buffer value.
24658  Description:
24659  This function returns 16-bit SPI buffer value.
24660  This operation is atomic.
24661  Precondition:
24662  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24663  Parameters:
24664  index - Identifier for the device instance to be configured
24665  Returns:
24666  Returns the SPI 16-bit buffer value.
24667  Example:
24668  <code>
24669 #define MY_SPI_INSTANCE SPI_ID_1
24670 
24671  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24672  </code>
24673  Remarks:
24674  This function implements an operation of the buffer control feature.
24675  This feature may not be available on all devices. Please refer to the
24676  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24677  in your application to automatically determine whether this feature is available.
24678  */
24679 
24680 uint16_t
24682  SPI_MODULE_ID index ) ;
24683 //******************************************************************************
24684 /* Function:
24685  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24686  Summary:
24687  Returns 32-bit SPI buffer value.
24688  Description:
24689  This function returns 32-bit SPI buffer value.
24690  This operation is atomic.
24691  Precondition:
24692  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24693  Parameters:
24694  index - Identifier for the device instance to be configured
24695  Returns:
24696  Returns the SPI 32-bit buffer value.
24697  Example:
24698  <code>
24699 #define MY_SPI_INSTANCE SPI_ID_1
24700 
24701  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24702  </code>
24703  Remarks:
24704  This function implements an operation of the buffer control feature.
24705  This feature may not be available on all devices. Please refer to the
24706  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24707  in your application to automatically determine whether this feature is available.
24708  */
24709 
24710 uint32_t
24712  SPI_MODULE_ID index ) ;
24713 //******************************************************************************
24714 /* Function:
24715  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24716  Summary:
24717  Write the data to the SPI buffer.
24718  Description:
24719  This function writes data to the SPI buffer.
24720  This operation is atomic.
24721  Precondition:
24722  None.
24723  Parameters:
24724  index - Identifier for the device instance to be configured
24725  data - Data to written to the SPI buffer
24726  Returns:
24727  None.
24728  Example:
24729  <code>
24730  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24731  // application developer.
24732  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24733  </code>
24734  Remarks:
24735  This function implements an operation of the buffer control feature.
24736  This feature may not be available on all devices. Please refer to the
24737  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24738  in your application to automatically determine whether this feature is available.
24739  */
24740 
24741 void
24743  SPI_MODULE_ID index ,
24744  uint8_t data ) ;
24745 //******************************************************************************
24746 /* Function:
24747  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24748  Summary:
24749  Writes 16-bit data to the SPI buffer.
24750  Description:
24751  This function writes 16-bit data to the SPI buffer.
24752  This operation is atomic.
24753  Precondition:
24754  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24755  Parameters:
24756  index - Identifier for the device instance to be configured
24757  data - 16-bit data to be written to the SPI buffer
24758  Returns:
24759  None.
24760  Example:
24761  <code>
24762 #define MY_SPI_INSTANCE SPI_ID_1
24763 
24764  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24765  </code>
24766  Remarks:
24767  This function implements an operation of the buffer control feature.
24768  This feature may not be available on all devices. Please refer to the
24769  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24770  in your application to automatically determine whether this feature is available.
24771  */
24772 
24773 void
24775  SPI_MODULE_ID index ,
24776  uint16_t data ) ;
24777 //******************************************************************************
24778 /* Function:
24779  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24780  Summary:
24781  Write 32-bit data to the SPI buffer.
24782  Description:
24783  This function writes 32-bit data to the SPI buffer.
24784  This operation is atomic.
24785  Precondition:
24786  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24787  Parameters:
24788  index - Identifier for the device instance to be configured
24789  data - 32-bit data to be written to the SPI buffer
24790  Returns:
24791  None.
24792  Example:
24793  <code>
24794 #define MY_SPI_INSTANCE SPI_ID_1
24795 
24796  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24797  </code>
24798  Remarks:
24799  This function implements an operation of the buffer control feature.
24800  This feature may not be available on all devices. Please refer to the
24801  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24802  in your application to automatically determine whether this feature is available.
24803  */
24804 
24805 void
24807  SPI_MODULE_ID index ,
24808  uint32_t data ) ;
24809 //******************************************************************************
24810 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24811  Summary:
24812  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24813  register.
24814  Description:
24815  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24816  (SPIxRXB)) register.
24817  This operation is atomic.
24818  Preconditions:
24819  None.
24820  Parameters:
24821  index - Identifier for the device instance
24822  Returns:
24823  The address of the SPIxBUF register
24824  Remarks:
24825  None.
24826 */
24827 
24828 void *
24830  SPI_MODULE_ID index ) ;
24831 //******************************************************************************
24832 /* Function:
24833  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24834  SPI_BAUD_RATE_CLOCK type)
24835  Summary:
24836  Selects the type of clock is used by the Baud Rate Generator.
24837  Description:
24838  This function selects the type of clock is used by the Baud Rate Generator.
24839  Precondition:
24840  None.
24841  Parameters:
24842  index - Identifier for the device instance to be configured
24843  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24844  Returns:
24845  None.
24846  Example:
24847  <code>
24848  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24849  // application developer.
24850  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24851  </code>
24852  Remarks:
24853  This function implements an operation of the baud rate clock control feature.
24854  This feature may not be available on all devices. Please refer to the
24855  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24856  in your application to automatically determine whether this feature is available.
24857  */
24858 
24859 void
24861  SPI_MODULE_ID index ,
24862  SPI_BAUD_RATE_CLOCK type ) ;
24863 //******************************************************************************
24864 /* Function:
24865  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24866  SPI_ERROR_INTERRUPT error)
24867  Summary:
24868  Enables SPI error interrupts
24869  Description:
24870  This function enables SPI error interrupts.
24871  Precondition:
24872  None.
24873  Parameters:
24874  index - Identifier for the device instance to be configured
24875  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24876  SPI interrupt error
24877  Returns:
24878  None.
24879  Example:
24880  <code>
24881  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24882  // application developer.
24883  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24884  </code>
24885  Remarks:
24886  This function implements an operation of the error interrupt control feature.
24887  This feature may not be available on all devices. Please refer to the
24888  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24889  in your application to automatically determine whether this feature is available.
24890  */
24891 
24892 void
24894  SPI_MODULE_ID index ,
24895  SPI_ERROR_INTERRUPT error ) ;
24896 //******************************************************************************
24897 /* Function:
24898  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24899  SPI_ERROR_INTERRUPT error)
24900  Summary:
24901  Enables SPI error interrupts.
24902  Description:
24903  This function enables SPI error interrupts.
24904  Precondition:
24905  None.
24906  Parameters:
24907  index - Identifier for the device instance to be configured
24908  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24909  SPI interrupt error
24910  Returns:
24911  None.
24912  Example:
24913  <code>
24914  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24915  // application developer.
24916  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24917  </code>
24918  Remarks:
24919  This function implements an operation of the error interrupt control feature.
24920  This feature may not be available on all devices. Please refer to the
24921  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24922  in your application to automatically determine whether this feature is available.
24923  */
24924 
24925 void
24927  SPI_MODULE_ID index ,
24928  SPI_ERROR_INTERRUPT error ) ;
24929 //******************************************************************************
24930 /* Function:
24931  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24932  Summary:
24933  Enables the SPI error.
24934  Description:
24935  This function enables the SPI error.
24936  This operation is atomic.
24937  Precondition:
24938  None.
24939  Parameters:
24940  index - Identifier for the device instance to be configured
24941  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24942  Returns:
24943  None.
24944  Example:
24945  <code>
24946  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24947  // application developer.
24948  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24949  </code>
24950  Remarks:
24951  This function implements an operation of the audio error control feature.
24952  This feature may not be available on all devices. Please refer to the
24953  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24954  in your application to automatically determine whether this feature is available.
24955  */
24956 
24957 void
24959  SPI_MODULE_ID index ,
24960  SPI_AUDIO_ERROR error ) ;
24961 //******************************************************************************
24962 /* Function:
24963  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24964  Summary:
24965  Disables the SPI error.
24966  Description:
24967  This function disables the SPI error.
24968  This operation is atomic.
24969  Precondition:
24970  None.
24971  Parameters:
24972  index - Identifier for the device instance to be configured
24973  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24974  Returns:
24975  None.
24976  Example:
24977  <code>
24978  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24979  // application developer.
24980  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24981  </code>
24982  Remarks:
24983  This function implements an operation of the audio error control feature.
24984  This feature may not be available on all devices. Please refer to the
24985  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24986  in your application to automatically determine whether this feature is available.
24987  */
24988 
24989 void
24991  SPI_MODULE_ID index ,
24992  SPI_AUDIO_ERROR error ) ;
24993 //******************************************************************************
24994 /* Function:
24995  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
24996  Summary:
24997  Audio protocol is enabled.
24998  Description:
24999  This function enables the audio protocol.
25000  This operation is atomic.
25001  Precondition:
25002  Disable the SPI module by calling PLIB_SPI_Disable.
25003  Parameters:
25004  index - Identifier for the device instance to be configured
25005  Returns:
25006  None.
25007  Example:
25008  <code>
25009  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25010  // application developer.
25011  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25012  </code>
25013  Remarks:
25014  This function implements an operation of the audio protocol control feature.
25015  This feature may not be available on all devices. Please refer to the
25016  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25017  in your application to automatically determine whether this feature is available.
25018  */
25019 
25020 void
25022  SPI_MODULE_ID index ) ;
25023 //******************************************************************************
25024 /* Function:
25025  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25026  Summary:
25027  Audio protocol is disabled.
25028  Description:
25029  This function disables the audio protocol.
25030  This operation is atomic.
25031  Precondition:
25032  None.
25033  Parameters:
25034  index - Identifier for the device instance to be configured
25035  Returns:
25036  None.
25037  Example:
25038  <code>
25039  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25040  // application developer.
25041  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25042  </code>
25043  Remarks:
25044  This function implements an operation of the audio protocol control feature.
25045  This feature may not be available on all devices. Please refer to the
25046  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25047  in your application to automatically determine whether this feature is available.
25048  */
25049 
25050 void
25052  SPI_MODULE_ID index ) ;
25053 //******************************************************************************
25054 /* Function:
25055  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25056  SPI_AUDIO_TRANSMIT_MODE mode)
25057  Summary:
25058  Selects the transmit audio data format.
25059  Description:
25060  This function selects the transmit audio data format.
25061  Precondition:
25062  None.
25063  Parameters:
25064  index - Identifier for the device instance to be configured
25065  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25066  transmit audio format
25067  Returns:
25068  None.
25069  Example:
25070  <code>
25071  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25072  // application developer.
25073  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25074  </code>
25075  Remarks:
25076  This function implements an operation of the audio transmit mode feature.
25077  This feature may not be available on all devices. Please refer to the
25078  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25079  in your application to automatically determine whether this feature is available.
25080  */
25081 
25082 void
25084  SPI_MODULE_ID index ,
25085  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25086 //******************************************************************************
25087 /* Function:
25088  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25089  SPI_AUDIO_PROTOCOL mode )
25090  Summary:
25091  Selects the Audio Protocol mode.
25092  Description:
25093  This function selects the Audio Protocol mode.
25094  Precondition:
25095  None.
25096  Parameters:
25097  index - Identifier for the device instance to be configured
25098  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25099  audio protocol
25100  Returns:
25101  None.
25102  Example:
25103  <code>
25104  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25105  // application developer.
25106  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25107  </code>
25108  Remarks:
25109  This function implements an operation of the audio protocol mode feature.
25110  This feature may not be available on all devices. Please refer to the
25111  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25112  in your application to automatically determine whether this feature is available.
25113  */
25114 
25115 void
25117  SPI_MODULE_ID index ,
25118  SPI_AUDIO_PROTOCOL mode ) ;
25119 // *****************************************************************************
25120 // *****************************************************************************
25121 // Section: SPI Peripheral Library Exists Functions
25122 // *****************************************************************************
25123 // *****************************************************************************
25124 /* The following functions indicate the existence of the features on the device.
25125 */
25126 //******************************************************************************
25127 /* Function:
25128  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25129  Summary:
25130  Identifies whether the EnableControl feature exists on the SPI module.
25131  Description:
25132  This function identifies whether the EnableControl feature is available on
25133  the SPI module.
25134  When this function returns true, these functions are supported on the device:
25135  - PLIB_SPI_Enable
25136  - PLIB_SPI_Disable
25137  This operation is atomic.
25138  Preconditions:
25139  None.
25140  Parameters:
25141  index - Identifier for the device instance
25142  Returns:
25143  - true - The EnableControl feature is supported on the device
25144  - false - The EnableControl feature is not supported on the device
25145  Remarks:
25146  None.
25147 */
25148 
25149 bool
25151  SPI_MODULE_ID index ) ;
25152 //******************************************************************************
25153 /* Function:
25154  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25155  Summary:
25156  Identifies whether the StopInIdle feature exists on the SPI module.
25157  Description:
25158  This function identifies whether the StopInIdle feature is available on the
25159  SPI module.
25160  When this function returns true, these functions are supported on the device:
25161  - PLIB_SPI_StopInIdleEnable
25162  - PLIB_SPI_StopInIdleDisable
25163  This operation is atomic.
25164  Preconditions:
25165  None.
25166  Parameters:
25167  index - Identifier for the device instance
25168  Returns:
25169  - true - The StopInIdle feature is supported on the device
25170  - false - The StopInIdle feature is not supported on the device
25171  Remarks:
25172  None.
25173 */
25174 
25175 bool
25177  SPI_MODULE_ID index ) ;
25178 //******************************************************************************
25179 /* Function:
25180  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25181  Summary:
25182  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25183  Description:
25184  This function identifies whether the ReceiverOverflow feature is available
25185  on the SPI module.
25186  When this function returns true, these functions are supported on the device:
25187  - PLIB_SPI_ReceiverHasOverflowed
25188  - PLIB_SPI_ReceiverOverflowClear
25189  This operation is atomic.
25190  Preconditions:
25191  None.
25192  Parameters:
25193  index - Identifier for the device instance
25194  Returns:
25195  - true - The ReceiverOverflow feature is supported on the device
25196  - false - The ReceiverOverflow feature is not supported on the device
25197  Remarks:
25198  None.
25199 */
25200 
25201 bool
25203  SPI_MODULE_ID index ) ;
25204 //******************************************************************************
25205 /* Function:
25206  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25207  Summary:
25208  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25209  Description:
25210  This function identifies whether the TransmitBufferFullStatus feature is available
25211  on the SPI module.
25212  When this function returns true, this function is supported on the device:
25213  - PLIB_SPI_TransmitBufferIsFull
25214  This operation is atomic.
25215  Preconditions:
25216  None.
25217  Parameters:
25218  index - Identifier for the device instance
25219  Returns:
25220  - true - The TransmitBufferFullStatus feature is supported on the device
25221  - false - The TransmitBufferFullStatus feature is not supported on the device
25222  Remarks:
25223  None.
25224 */
25225 
25226 bool
25228  SPI_MODULE_ID index ) ;
25229 //******************************************************************************
25230 /* Function:
25231  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25232  Summary:
25233  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25234  Description:
25235  This function identifies whether the TransmitBufferEmptyStatus feature is available
25236  on the SPI module.
25237  When this function returns true, this function is supported on the device:
25238  - PLIB_SPI_TransmitBufferIsEmpty
25239  This operation is atomic.
25240  Preconditions:
25241  None.
25242  Parameters:
25243  index - Identifier for the device instance
25244  Returns:
25245  - true - The TransmitBufferEmptyStatus feature is supported on the device
25246  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25247  Remarks:
25248  None.
25249 */
25250 
25251 bool
25253  SPI_MODULE_ID index ) ;
25254 //******************************************************************************
25255 /* Function:
25256  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25257  Summary:
25258  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25259  Description:
25260  This function identifies whether the ReceiveBufferStatus feature is available
25261  on the SPI module.
25262  When this function returns true, this function is supported on the device:
25263  - PLIB_SPI_ReceiverBufferIsFull
25264  This operation is atomic.
25265  Preconditions:
25266  None.
25267  Parameters:
25268  index - Identifier for the device instance
25269  Returns:
25270  - true - The ReceiveBufferStatus feature is supported on the device
25271  - false - The ReceiveBufferStatus feature is not supported on the device
25272  Remarks:
25273  None.
25274 */
25275 
25276 bool
25278  SPI_MODULE_ID index ) ;
25279 //******************************************************************************
25280 /* Function:
25281  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25282  Summary:
25283  Identifies whether the PinControl feature exists on the SPI module.
25284  Description:
25285  This function identifies whether the PinControl feature is available on the
25286  SPI module.
25287  When this function returns true, these functions are supported on the device:
25288  - PLIB_SPI_PinEnable
25289  - PLIB_SPI_PinDisable
25290  This operation is atomic.
25291  Preconditions:
25292  None.
25293  Parameters:
25294  index - Identifier for the device instance
25295  Returns:
25296  - true - The PinControl feature is supported on the device
25297  - false - The PinControl feature is not supported on the device
25298  Remarks:
25299  None.
25300 */
25301 
25302 bool
25304  SPI_MODULE_ID index ) ;
25305 //******************************************************************************
25306 /* Function:
25307  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25308  Summary:
25309  Identifies whether the CommunicationWidth feature exists on the SPI module.
25310  Description:
25311  This function identifies whether the CommunicationWidth feature is available
25312  on the SPI module.
25313  When this function returns true, this function is supported on the device:
25314  - PLIB_SPI_CommunicationWidthSelect
25315  This operation is atomic.
25316  Preconditions:
25317  None.
25318  Parameters:
25319  index - Identifier for the device instance
25320  Returns:
25321  - true - The CommunicationWidth feature is supported on the device
25322  - false - The CommunicationWidth feature is not supported on the device
25323  Remarks:
25324  None.
25325 */
25326 
25327 bool
25329  SPI_MODULE_ID index ) ;
25330 //******************************************************************************
25331 /* Function:
25332  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25333  Summary:
25334  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25335  Description:
25336  This function identifies whether the AudioCommunicationWidth feature is available
25337  on the SPI module.
25338  When this function returns true, this function is supported on the device:
25339  - PLIB_SPI_AudioCommunicationWidthSelect
25340  This operation is atomic.
25341  Preconditions:
25342  None.
25343  Parameters:
25344  index - Identifier for the device instance
25345  Returns:
25346  - true - The AudioCommunicationWidth feature is supported on the device
25347  - false - The AudioCommunicationWidth feature is not supported on the device
25348  Remarks:
25349  None.
25350 */
25351 
25352 bool
25354  SPI_MODULE_ID index ) ;
25355 //******************************************************************************
25356 /* Function:
25357  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25358  Summary:
25359  Identifies whether the InputSamplePhase feature exists on the SPI module.
25360  Description:
25361  This function identifies whether the InputSamplePhase feature is available
25362  on the SPI module.
25363  When this function returns true, this function is supported on the device:
25364  - PLIB_SPI_InputSamplePhaseSelect
25365  This operation is atomic.
25366  Preconditions:
25367  None.
25368  Parameters:
25369  index - Identifier for the device instance
25370  Returns:
25371  - true - The InputSamplePhase feature is supported on the device
25372  - false - The InputSamplePhase feature is not supported on the device
25373  Remarks:
25374  None.
25375 */
25376 
25377 bool
25379  SPI_MODULE_ID index ) ;
25380 //******************************************************************************
25381 /* Function:
25382  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25383  Summary:
25384  Identifies whether the OutputDataPhase feature exists on the SPI module.
25385  Description:
25386  This function identifies whether the OutputDataPhase feature is available on
25387  the SPI module.
25388  When this function returns true, this function is supported on the device:
25389  - PLIB_SPI_OutputDataPhaseSelect
25390  This operation is atomic.
25391  Preconditions:
25392  None.
25393  Parameters:
25394  index - Identifier for the device instance
25395  Returns:
25396  - true - The OutputDataPhase feature is supported on the device
25397  - false - The OutputDataPhase feature is not supported on the device
25398  Remarks:
25399  None.
25400 */
25401 
25402 bool
25404  SPI_MODULE_ID index ) ;
25405 //******************************************************************************
25406 /* Function:
25407  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25408  Summary:
25409  Identifies whether the ClockPolarity feature exists on the SPI module.
25410  Description:
25411  This function identifies whether the ClockPolarity feature is available on
25412  the SPI module.
25413  When this function returns true, this function is supported on the device:
25414  - PLIB_SPI_ClockPolaritySelect
25415  This operation is atomic.
25416  Preconditions:
25417  None.
25418  Parameters:
25419  index - Identifier for the device instance
25420  Returns:
25421  - true - The ClockPolarity feature is supported on the device
25422  - false - The ClockPolarity feature is not supported on the device
25423  Remarks:
25424  None.
25425 */
25426 
25427 bool
25429  SPI_MODULE_ID index ) ;
25430 //******************************************************************************
25431 /* Function:
25432  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25433  Summary:
25434  Identifies whether the MasterControl feature exists on the SPI module.
25435  Description:
25436  This function identifies whether the MasterControl feature is available on
25437  the SPI module.
25438  When this function returns true, these functions are supported on the device:
25439  - PLIB_SPI_MasterEnable
25440  - PLIB_SPI_SlaveEnable
25441  This operation is atomic.
25442  Preconditions:
25443  None.
25444  Parameters:
25445  index - Identifier for the device instance
25446  Returns:
25447  - true - The MasterControl feature is supported on the device
25448  - false - The MasterControl feature is not supported on the device
25449  Remarks:
25450  None.
25451 */
25452 
25453 bool
25455  SPI_MODULE_ID index ) ;
25456 //******************************************************************************
25457 /* Function:
25458  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25459  Summary:
25460  Identifies whether the BaudRate feature exists on the SPI module.
25461  Description:
25462  This function identifies whether the BaudRate feature is available on the SPI
25463  module.
25464  When this function returns true, this function is supported on the device:
25465  - PLIB_SPI_BaudRateSet
25466  This operation is atomic.
25467  Preconditions:
25468  None.
25469  Parameters:
25470  index - Identifier for the device instance
25471  Returns:
25472  - true - The BaudRate feature is supported on the device
25473  - false - The BaudRate feature is not supported on the device
25474  Remarks:
25475  None.
25476 */
25477 
25478 bool
25480  SPI_MODULE_ID index ) ;
25481 //******************************************************************************
25482 /* Function:
25483  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25484  Summary:
25485  Identifies whether the BusStatus feature exists on the SPI module.
25486  Description:
25487  This function identifies whether the BusStatus feature is available on the
25488  SPI module.
25489  When this function returns true, this function is supported on the device:
25490  - PLIB_SPI_IsBusy
25491  This operation is atomic.
25492  Preconditions:
25493  None.
25494  Parameters:
25495  index - Identifier for the device instance
25496  Returns:
25497  - true - The BusStatus feature is supported on the device
25498  - false - The BusStatus feature is not supported on the device
25499  Remarks:
25500  None.
25501 */
25502 
25503 bool
25505  SPI_MODULE_ID index ) ;
25506 //******************************************************************************
25507 /* Function:
25508  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25509  Summary:
25510  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25511  Description:
25512  This function identifies whether the ReadDataSignStatus feature is available
25513  on the SPI module.
25514  When this function returns true, this function is supported on the device:
25515  - PLIB_SPI_ReadDataIsSignExtended
25516  This operation is atomic.
25517  Preconditions:
25518  None.
25519  Parameters:
25520  index - Identifier for the device instance
25521  Returns:
25522  - true - The ReadDataSignStatus feature is supported on the device
25523  - false - The ReadDataSignStatus feature is not supported on the device
25524  Remarks:
25525  None.
25526 */
25527 
25528 bool
25530  SPI_MODULE_ID index ) ;
25531 //******************************************************************************
25532 /* Function:
25533  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25534  Summary:
25535  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25536  Description:
25537  This function identifies whether the SlaveSelectControl feature is available
25538  on the SPI module.
25539  When this function returns true, these functions are supported on the device:
25540  - PLIB_SPI_SlaveSelectEnable
25541  - PLIB_SPI_SlaveSelectDisable
25542  This operation is atomic.
25543  Preconditions:
25544  None.
25545  Parameters:
25546  index - Identifier for the device instance
25547  Returns:
25548  - true - The SlaveSelectControl feature is supported on the device
25549  - false - The SlaveSelectControl feature is not supported on the device
25550  Remarks:
25551  None.
25552 */
25553 
25554 bool
25556  SPI_MODULE_ID index ) ;
25557 //******************************************************************************
25558 /* Function:
25559  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25560  Summary:
25561  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25562  Description:
25563  This function identifies whether the TransmitUnderRunStatus feature is available
25564  on the SPI module.
25565  When this function returns true, these functions are supported on the device:
25566  - PLIB_SPI_TransmitUnderRunStatusGet
25567  - PLIB_SPI_TransmitUnderRunStatusClear
25568  This operation is atomic.
25569  Preconditions:
25570  None.
25571  Parameters:
25572  index - Identifier for the device instance
25573  Returns:
25574  - true - The TransmitUnderRunStatus feature is supported on the device
25575  - false - The TransmitUnderRunStatus feature is not supported on the device
25576  Remarks:
25577  None.
25578 */
25579 
25580 bool
25582  SPI_MODULE_ID index ) ;
25583 //******************************************************************************
25584 /* Function:
25585  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25586  Summary:
25587  Identifies whether the FIFOControl feature exists on the SPI module.
25588  Description:
25589  This function identifies whether the FIFOControl feature is available on the
25590  SPI module.
25591  When this function returns true, these functions are supported on the device:
25592  - PLIB_SPI_FIFOEnable
25593  - PLIB_SPI_FIFODisable
25594  This operation is atomic.
25595  Preconditions:
25596  None.
25597  Parameters:
25598  index - Identifier for the device instance
25599  Returns:
25600  - true - The FIFOControl feature is supported on the device
25601  - false - The FIFOControl feature is not supported on the device
25602  Remarks:
25603  None.
25604 */
25605 
25606 bool
25608  SPI_MODULE_ID index ) ;
25609 //******************************************************************************
25610 /* Function:
25611  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25612  Summary:
25613  Identifies whether the FIFOCount feature exists on the SPI module.
25614  Description:
25615  This function identifies whether the FIFOCount feature is available on the SPI module.
25616  When this function returns true, this function is supported on the device:
25617  - PLIB_SPI_FIFOCountGet
25618  This operation is atomic.
25619  Preconditions:
25620  None.
25621  Parameters:
25622  index - Identifier for the device instance
25623  Returns:
25624  - true - The FIFOCount feature is supported on the device
25625  - false - The FIFOCount feature is not supported on the device
25626  Remarks:
25627  None.
25628 */
25629 
25630 bool
25632  SPI_MODULE_ID index ) ;
25633 //******************************************************************************
25634 /* Function:
25635  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25636  Summary:
25637  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25638  Description:
25639  This function identifies whether the ReceiveFIFOStatus feature is available
25640  on the SPI module.
25641  When this function returns true, this function is supported on the device:
25642  - PLIB_SPI_ReceiverFIFOIsEmpty
25643  This operation is atomic.
25644  Preconditions:
25645  None.
25646  Parameters:
25647  index - Identifier for the device instance
25648  Returns:
25649  - true - The ReceiveFIFOStatus feature is supported on the device
25650  - false - The ReceiveFIFOStatus feature is not supported on the device
25651  Remarks:
25652  None.
25653 */
25654 
25655 bool
25657  SPI_MODULE_ID index ) ;
25658 //******************************************************************************
25659 /* Function:
25660  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25661  Summary:
25662  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25663  Description:
25664  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25665  available on the SPI module.
25666  When this function returns true, this function is supported on the device:
25667  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25668  This operation is atomic.
25669  Preconditions:
25670  None.
25671  Parameters:
25672  index - Identifier for the device instance
25673  Returns:
25674  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25675  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25676  Remarks:
25677  None.
25678 */
25679 
25680 bool
25682  SPI_MODULE_ID index ) ;
25683 //******************************************************************************
25684 /* Function:
25685  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25686  Summary:
25687  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25688  Description:
25689  This function identifies whether the FIFOInterruptMode feature is available
25690  on the SPI module.
25691  When this function returns true, this function is supported on the device:
25692  - PLIB_SPI_FIFOInterruptModeSelect
25693  This operation is atomic.
25694  Preconditions:
25695  None.
25696  Parameters:
25697  index - Identifier for the device instance
25698  Returns:
25699  - true - The FIFOInterruptMode feature is supported on the device
25700  - false - The FIFOInterruptMode feature is not supported on the device
25701  Remarks:
25702  None.
25703 */
25704 
25705 bool
25707  SPI_MODULE_ID index ) ;
25708 //******************************************************************************
25709 /* Function:
25710  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25711  Summary:
25712  Identifies whether the FramedCommunication feature exists on the SPI module.
25713  Description:
25714  This function identifies whether the FramedCommunication feature is available
25715  on the SPI module.
25716  When this function returns true, these functions are supported on the device:
25717  - PLIB_SPI_FramedCommunicationEnable
25718  - PLIB_SPI_FramedCommunicationDisable
25719  This operation is atomic.
25720  Preconditions:
25721  None.
25722  Parameters:
25723  index - Identifier for the device instance
25724  Returns:
25725  - true - The FramedCommunication feature is supported on the device
25726  - false - The FramedCommunication feature is not supported on the device
25727  Remarks:
25728  None.
25729 */
25730 
25731 bool
25733  SPI_MODULE_ID index ) ;
25734 //******************************************************************************
25735 /* Function:
25736  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25737  Summary:
25738  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25739  Description:
25740  This function identifies whether the FrameSyncPulseDirection feature is available
25741  on the SPI module.
25742  When this function returns true, this function is supported on the device:
25743  - PLIB_SPI_FrameSyncPulseDirectionSelect
25744  This operation is atomic.
25745  Preconditions:
25746  None.
25747  Parameters:
25748  index - Identifier for the device instance
25749  Returns:
25750  - true - The FrameSyncPulseDirection feature is supported on the device
25751  - false - The FrameSyncPulseDirection feature is not supported on the device
25752  Remarks:
25753  None.
25754 */
25755 
25756 bool
25758  SPI_MODULE_ID index ) ;
25759 //******************************************************************************
25760 /* Function:
25761  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25762  Summary:
25763  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25764  Description:
25765  This function identifies whether the FrameSyncPulsePolarity feature is available
25766  on the SPI module.
25767  When this function returns true, this function is supported on the device:
25768  - PLIB_SPI_FrameSyncPulsePolaritySelect
25769  This operation is atomic.
25770  Preconditions:
25771  None.
25772  Parameters:
25773  index - Identifier for the device instance
25774  Returns:
25775  - true - The FrameSyncPulsePolarity feature is supported on the device
25776  - false - The FrameSyncPulsePolarity feature is not supported on the device
25777  Remarks:
25778  None.
25779 */
25780 
25781 bool
25783  SPI_MODULE_ID index ) ;
25784 //******************************************************************************
25785 /* Function:
25786  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25787  Summary:
25788  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25789  Description:
25790  This function identifies whether the FrameSyncPulseEdge feature is available
25791  on the SPI module.
25792  When this function returns true, this function is supported on the device:
25793  - PLIB_SPI_FrameSyncPulseEdgeSelect
25794  This operation is atomic.
25795  Preconditions:
25796  None.
25797  Parameters:
25798  index - Identifier for the device instance
25799  Returns:
25800  - true - The FrameSyncPulseEdge feature is supported on the device
25801  - false - The FrameSyncPulseEdge feature is not supported on the device
25802  Remarks:
25803  None.
25804 */
25805 
25806 bool
25808  SPI_MODULE_ID index ) ;
25809 //******************************************************************************
25810 /* Function:
25811  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25812  Summary:
25813  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25814  Description:
25815  This function identifies whether the FrameSyncPulseWidth feature is available
25816  on the SPI module.
25817  When this function returns true, this function is supported on the device:
25818  - PLIB_SPI_FrameSyncPulseWidthSelect
25819  This operation is atomic.
25820  Preconditions:
25821  None.
25822  Parameters:
25823  index - Identifier for the device instance
25824  Returns:
25825  - true - The FrameSyncPulseWidth feature is supported on the device
25826  - false - The FrameSyncPulseWidth feature is not supported on the device
25827  Remarks:
25828  None.
25829 */
25830 
25831 bool
25833  SPI_MODULE_ID index ) ;
25834 //******************************************************************************
25835 /* Function:
25836  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25837  Summary:
25838  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25839  Description:
25840  This function identifies whether the FrameSyncPulseCounter feature is available
25841  on the SPI module.
25842  When this function returns true, this function is supported on the device:
25843  - PLIB_SPI_FrameSyncPulseCounterSelect
25844  This operation is atomic.
25845  Preconditions:
25846  None.
25847  Parameters:
25848  index - Identifier for the device instance
25849  Returns:
25850  - true - The FrameSyncPulseCounter feature is supported on the device
25851  - false - The FrameSyncPulseCounter feature is not supported on the device
25852  Remarks:
25853  None.
25854 */
25855 
25856 bool
25858  SPI_MODULE_ID index ) ;
25859 //******************************************************************************
25860 /* Function:
25861  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25862  Summary:
25863  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25864  Description:
25865  This function identifies whether the FrameErrorStatus feature is available on
25866  the SPI module.
25867  When this function returns true, these functions are supported on the device:
25868  - PLIB_SPI_FrameErrorStatusGet
25869  - PLIB_SPI_FrameErrorStatusClear
25870  This operation is atomic.
25871  Preconditions:
25872  None.
25873  Parameters:
25874  index - Identifier for the device instance
25875  Returns:
25876  - true - The FrameErrorStatus feature is supported on the device
25877  - false - The FrameErrorStatus feature is not supported on the device
25878  Remarks:
25879  None.
25880 */
25881 
25882 bool
25884  SPI_MODULE_ID index ) ;
25885 //******************************************************************************
25886 /* Function:
25887  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25888  Summary:
25889  Identifies whether the Buffer feature exists on the SPI module.
25890  Description:
25891  This function identifies whether the Buffer feature is available on the SPI module.
25892  When this function returns true, these functions are supported on the device:
25893  - PLIB_SPI_BufferClear
25894  - PLIB_SPI_BufferRead
25895  - PLIB_SPI_BufferWrite
25896  - PLIB_SPI_BufferAddressGet
25897  This operation is atomic.
25898  Preconditions:
25899  None.
25900  Parameters:
25901  index - Identifier for the device instance
25902  Returns:
25903  - true - The Buffer feature is supported on the device
25904  - false - The Buffer feature is not supported on the device
25905  Remarks:
25906  None.
25907 */
25908 
25909 bool
25911  SPI_MODULE_ID index ) ;
25912 //******************************************************************************
25913 /* Function:
25914  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25915  Summary:
25916  Identifies whether the BaudRateClock feature exists on the SPI module.
25917  Description:
25918  This function identifies whether the BaudRateClock feature is available on
25919  the SPI module.
25920  When this function returns true, this function is supported on the device:
25921  - PLIB_SPI_BaudRateClockSelect
25922  This operation is atomic.
25923  Preconditions:
25924  None.
25925  Parameters:
25926  index - Identifier for the device instance
25927  Returns:
25928  - true - The BaudRateClock feature is supported on the device
25929  - false - The BaudRateClock feature is not supported on the device
25930  Remarks:
25931  None.
25932 */
25933 
25934 bool
25936  SPI_MODULE_ID index ) ;
25937 //******************************************************************************
25938 /* Function:
25939  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25940  Summary:
25941  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25942  Description:
25943  This function identifies whether the ErrorInterruptControl feature is available
25944  on the SPI module.
25945  When this function returns true, these functions are supported on the device:
25946  - PLIB_SPI_ErrorInterruptEnable
25947  - PLIB_SPI_ErrorInterruptDisable
25948  This operation is atomic.
25949  Preconditions:
25950  None.
25951  Parameters:
25952  index - Identifier for the device instance
25953  Returns:
25954  - true - The ErrorInterruptControl feature is supported on the device
25955  - false - The ErrorInterruptControl feature is not supported on the device
25956  Remarks:
25957  None.
25958 */
25959 
25960 bool
25962  SPI_MODULE_ID index ) ;
25963 //******************************************************************************
25964 /* Function:
25965  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25966  Summary:
25967  Identifies whether the AudioErrorControl feature exists on the SPI module.
25968  Description:
25969  This function identifies whether the AudioErrorControl feature is available
25970  on the SPI module.
25971  When this function returns true, these functions are supported on the device:
25972  - PLIB_SPI_AudioErrorEnable
25973  - PLIB_SPI_AudioErrorDisable
25974  This operation is atomic.
25975  Preconditions:
25976  None.
25977  Parameters:
25978  index - Identifier for the device instance
25979  Returns:
25980  - true - The AudioErrorControl feature is supported on the device
25981  - false - The AudioErrorControl feature is not supported on the device
25982  Remarks:
25983  None.
25984 */
25985 
25986 bool
25988  SPI_MODULE_ID index ) ;
25989 //******************************************************************************
25990 /* Function:
25991  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25992  Summary:
25993  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25994  Description:
25995  This function identifies whether the AudioProtocolControl feature is available
25996  on the SPI module.
25997  When this function returns true, this function is supported on the device:
25998  - PLIB_SPI_AudioProtocolEnable
25999  - PLIB_SPI_AudioProtocolDisable
26000  This operation is atomic.
26001  Preconditions:
26002  None.
26003  Parameters:
26004  index - Identifier for the device instance
26005  Returns:
26006  - true - The AudioProtocolControl feature is supported on the device
26007  - false - The AudioProtocolControl feature is not supported on the device
26008  Remarks:
26009  None.
26010 */
26011 
26012 bool
26014  SPI_MODULE_ID index ) ;
26015 //******************************************************************************
26016 /* Function:
26017  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26018  Summary:
26019  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26020  Description:
26021  This function identifies whether the AudioTransmitMode feature is available
26022  on the SPI module.
26023  When this function returns true, this function is supported on the device:
26024  - PLIB_SPI_AudioTransmitModeSelect
26025  This operation is atomic.
26026  Preconditions:
26027  None.
26028  Parameters:
26029  index - Identifier for the device instance
26030  Returns:
26031  - true - The AudioTransmitMode feature is supported on the device
26032  - false - The AudioTransmitMode feature is not supported on the device
26033  Remarks:
26034  None.
26035 */
26036 
26037 bool
26039  SPI_MODULE_ID index ) ;
26040 //******************************************************************************
26041 /* Function:
26042  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26043  Summary:
26044  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26045  Description:
26046  This function identifies whether the AudioProtocolMode feature is available
26047  on the SPI module.
26048  When this function returns true, this function is supported on the device:
26049  - PLIB_SPI_AudioProtocolModeSelect
26050  This operation is atomic.
26051  Preconditions:
26052  None.
26053  Parameters:
26054  index - Identifier for the device instance
26055  Returns:
26056  - true - The AudioProtocolMode feature is supported on the device
26057  - false - The AudioProtocolMode feature is not supported on the device
26058  Remarks:
26059  None.
26060 */
26061 
26062 bool
26064  SPI_MODULE_ID index ) ;
26065 //******************************************************************************
26066 /* Function:
26067  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26068  Summary:
26069  Identifies whether the Buffer32bit feature exists on the SPI module.
26070  Description:
26071  This function identifies whether the Buffer32bit feature is available on the
26072  SPI module.
26073  When this function returns true, these functions are supported on the device:
26074  - PLIB_SPI_BufferRead32bit
26075  - PLIB_SPI_BufferWrite32bit
26076  This operation is atomic.
26077  Preconditions:
26078  None.
26079  Parameters:
26080  index - Identifier for the device instance
26081  Returns:
26082  - true - The Buffer32bit feature is supported on the device
26083  - false - The Buffer32bit feature is not supported on the device
26084  Remarks:
26085  None.
26086 */
26087 
26088 bool
26090  SPI_MODULE_ID index ) ;
26091 //******************************************************************************
26092 /* Function:
26093  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26094  Summary:
26095  Identifies whether the Buffer16bit feature exists on the SPI module.
26096  Description:
26097  This function identifies whether the Buffer16bit feature is available on the
26098  SPI module.
26099  When this function returns true, these functions are supported on the device:
26100  - PLIB_SPI_BufferRead16bit
26101  - PLIB_SPI_BufferWrite16bit
26102  This operation is atomic.
26103  Preconditions:
26104  None.
26105  Parameters:
26106  index - Identifier for the device instance
26107  Returns:
26108  - true - The Buffer16bit feature is supported on the device
26109  - false - The Buffer16bit feature is not supported on the device
26110  Remarks:
26111  None.
26112 */
26113 
26114 bool
26116  SPI_MODULE_ID index ) ;
26117 //DOM-IGNORE-BEGIN
26118 //DOM-IGNORE-END
26119  // #ifndef _PLIB_SPI_H
26120 /*******************************************************************************
26121  End of File
26122  */
26123 
26124 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26125 /* CLOSE_FILE Include File */
26126 
26127  // SPI PLIB Header
26128 #include "system/common/sys_common.h" // Common System Service Definitions
26129 #include "system/common/sys_module.h" // Module/Driver Definitions
26130 #include "system/int/sys_int.h" // System Interrupt Definitions
26131 #include "system/clk/sys_clk.h"
26132 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26133  /* LDRA full path */
26134 // DOM-IGNORE-BEGIN
26135 // DOM-IGNORE-END
26136 // *****************************************************************************
26137 /* SPI Driver Buffer Handle
26138  Summary:
26139  Handle identifying a read or write buffer passed to the driver.
26140  Description:
26141  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26142  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26143  This handle is associated with the buffer passed into the function and
26144  it allows the application to track the completion of the data from (or into)
26145  that buffer. The buffer handle value returned from the "buffer add" function
26146  is returned back to the client by the "callback" function registered with
26147  the driver.
26148  The buffer handle assigned to a client request expires when the client has
26149  been notified of the completion of the buffer transfer (after event handler
26150  function that notifies the client returns) or after the buffer has been
26151  retired by the driver if no event handler callback was set.
26152  Remarks:
26153  None.
26154 */
26155 
26156 typedef
26157 uintptr_t
26159 // *****************************************************************************
26160 /* SPI Driver Invalid Buffer Handle
26161  Summary:
26162  Definition of an invalid buffer handle.
26163  Description:
26164  This is the definition of an invalid buffer handle. An invalid buffer handle
26165  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26166  function if the buffer add request was not successful.
26167  Remarks:
26168  None.
26169 */
26170 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26171 // *****************************************************************************
26172 /* SPI Driver Module Index Numbers
26173  Summary:
26174  SPI driver index definitions.
26175  Description:
26176  These constants provide the SPI driver index definitions.
26177  Remarks:
26178  These constants should be used in place of hard-coded numeric literals.
26179  These values should be passed into the DRV_SPI_Initialize and
26180  DRV_SPI_Open functions to identify the driver instance in use.
26181 */
26182 #define DRV_SPI_INDEX_0 0
26183 #define DRV_SPI_INDEX_1 1
26184 #define DRV_SPI_INDEX_2 2
26185 #define DRV_SPI_INDEX_3 3
26186 #define DRV_SPI_INDEX_4 4
26187 #define DRV_SPI_INDEX_5 5
26188 // *****************************************************************************
26189 /* SPI Driver Module Index Count
26190  Summary:
26191  Number of valid SPI driver indices.
26192  Description:
26193  This constant identifies the number of valid SPI driver indices.
26194  Remarks:
26195  This constant should be used in place of hard-coded numeric literals.
26196  This value is derived from device-specific header files defined as part
26197  of the peripheral libraries.
26198 */
26199 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26200 // *****************************************************************************
26201 /* SPI Clock Mode Selection
26202  Summary:
26203  Identifies the various clock modes of the SPI module.
26204  Description:
26205  This enumeration identifies the various clock modes of the SPI module.
26206  Remarks:
26207  None.
26208 */
26209 
26210 typedef
26211  enum
26212  {
26213  /* SPI Clock Mode 0:
26214  - Idle State of the clock is Low
26215  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26216  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26218  /*DOM-IGNORE-BEGIN*/
26219  = 0 /*DOM-IGNORE-END*/
26220  ,
26221  /* SPI Clock Mode 1:
26222  - Idle State of the clock is Low
26223  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26224  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26226  /*DOM-IGNORE-BEGIN*/
26227  = 1 /*DOM-IGNORE-END*/
26228  ,
26229  /* SPI Clock Mode 2:
26230  - Idle State of the clock is High
26231  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26232  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26234  /*DOM-IGNORE-BEGIN*/
26235  = 2 /*DOM-IGNORE-END*/
26236  ,
26237  /* SPI Clock Mode 3:
26238  - Idle State of the clock is High
26239  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26240  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26242  /*DOM-IGNORE-BEGIN*/
26243  = 3 /*DOM-IGNORE-END*/
26244  } DRV_SPI_CLOCK_MODE ;
26245 // *****************************************************************************
26246 /* SPI Buffer Type Selection
26247  Summary:
26248  Identifies the various buffer types of the SPI module.
26249  Description:
26250  This enumeration identifies the various buffer types of the SPI module.
26251  Remarks:
26252  None.
26253 */
26254 
26255 typedef
26256  enum
26257  {
26258  /* SPI Buffer Type Standard */
26260  /*DOM-IGNORE-BEGIN*/
26261  = 0 /*DOM-IGNORE-END*/
26262  ,
26263  /* SPI Enhanced Buffer Type */
26265  /*DOM-IGNORE-BEGIN*/
26266  = 1 /*DOM-IGNORE-END*/
26268 // *****************************************************************************
26269 /* SPI Protocols Enumeration
26270  Summary:
26271  Identifies the various protocols of the SPI module.
26272  Description:
26273  This enumeration identifies the various protocols of the SPI module.
26274  Remarks:
26275  None.
26276 */
26277 
26278 typedef
26279  enum
26280  {
26281  /* SPI Protocol Type Standard */
26283  /*DOM-IGNORE-BEGIN*/
26284  = 0 /*DOM-IGNORE-END*/
26285  ,
26286  /* SPI Protocol Type Framed */
26288  /*DOM-IGNORE-BEGIN*/
26289  = 1 /*DOM-IGNORE-END*/
26290  ,
26291  /*SPI Protocol Type Audio*/
26293  /*DOM-IGNORE-BEGIN*/
26294  = 2 /*DOM-IGNORE-END*/
26296 // *****************************************************************************
26297 /* SPI Driver Buffer Events
26298  Summary
26299  Identifies the possible events that can result from a buffer add request.
26300  Description
26301  This enumeration identifies the possible events that can result from a
26302  buffer add request caused by the client calling either
26303  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26304  Remarks:
26305  One of these values is passed in the "event" parameter of the event
26306  handling callback function that the client registered during buffer add
26307  requests.
26308 */
26309 
26310 typedef
26311  enum
26312  {
26313  /* Buffer is pending to get processed */
26315  /* Buffer is being processed */
26317  /* All data from or to the buffer was transferred successfully. */
26319  /* There was an error while processing the buffer transfer request. */
26322 // *****************************************************************************
26323 /* SPI Usage Modes Enumeration
26324  Summary:
26325  Identifies the various usage modes of the SPI module.
26326  Description:
26327  This enumeration identifies the various usage modes of the SPI module.
26328  Remarks:
26329  None.
26330 */
26331 
26332 typedef
26333  enum
26334  {
26335  /* SPI Mode Master */
26337  /*DOM-IGNORE-BEGIN*/
26338  = 0 /*DOM-IGNORE-END*/
26339  ,
26340  /* SPI Mode Slave */
26342  /*DOM-IGNORE-BEGIN*/
26343  = 1 /*DOM-IGNORE-END*/
26344  } DRV_SPI_MODE ;
26345 // *****************************************************************************
26346 /* SPI Task Modes Enumeration
26347  Summary:
26348  Identifies the various modes of how the tasks function will be run.
26349  Description:
26350  This enumeration identifies the various tasks mode
26351  Remarks:
26352  None.
26353 */
26354 
26355 typedef
26356  enum
26357  {
26358  /* Task is configured to run in polled mode */
26360  /*DOM-IGNORE-BEGIN*/
26361  = 0 /*DOM-IGNORE-END*/
26362  ,
26363  /* Task is configured to run in interrupt mode */
26365  /*DOM-IGNORE-BEGIN*/
26366  = 1 /*DOM-IGNORE-END*/
26367  } DRV_SPI_TASK_MODE ;
26368 // *****************************************************************************
26369 /* SPI Driver Buffer Event Handler Function Pointer
26370  Summary:
26371  Pointer to a SPI Driver Buffer Event handler function
26372  Description:
26373  This data type defines the required function signature for the SPI driver
26374  buffer event handling callback function. A client must register a pointer
26375  to a buffer event handling function who's function signature (parameter
26376  and return value types) match the types specified by this function pointer
26377  in order to receive buffer related event calls back from the driver.
26378  The parameters and return values and return value are described here and
26379  a partial example implementation is provided.
26380  Parameters:
26381  event - Identifies the type of event
26382  bufferHandle - Handle identifying the buffer to which the vent relates
26383  context - Value identifying the context of the application that
26384  registered the event handling function.
26385  Returns:
26386  None.
26387  Example:
26388  <code>
26389  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26390  DRV_SPI_BUFFER_HANDLE bufferHandle,
26391  uintptr_t context )
26392  {
26393  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26394  switch(event)
26395  {
26396  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26397  // Handle the completed buffer.
26398  break;
26399  case DRV_SPI_BUFFER_EVENT_ERROR:
26400  default:
26401  // Handle error.
26402  break;
26403  }
26404  }
26405  </code>
26406  Remarks:
26407  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26408  transferred successfully.
26409  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26410  not transferred successfully.
26411  The bufferHandle parameter contains the buffer handle of the buffer that
26412  failed.
26413  The context parameter contains the a handle to the client context,
26414  provided at the time the event handling function registration.
26415  This context handle value is passed back to the client as the "context"
26416  parameter. It can be any value necessary to identify the client context
26417  or instance (such as a pointer to the client's data) instance of the
26418  client that made the buffer add request.
26419  The event handler function executes in an interrupt context when the driver
26420  is configured for interrupt mode operation. It is recommended of the
26421  application to not perform process intensive operations with in this
26422  function.
26423 */
26424 
26425 typedef
26427 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26428 void * context ) ;
26429 // *****************************************************************************
26430 /* SPI Driver Initialization Data
26431  Summary:
26432  Defines the data required to initialize or reinitialize the SPI driver
26433  Description:
26434  This data type defines the data required to initialize or reinitialize the
26435  SPI driver. If the driver is built statically, the members of this data
26436  structure are statically over-ridden by static override definitions in the
26437  system_config.h file.
26438  Remarks:
26439  None.
26440 */
26441 
26442 typedef
26443 struct _DRV_SPI_INIT
26444 {
26445  /* System module initialization */
26446  SYS_MODULE_INIT moduleInit ;
26447  /* Identifies peripheral (PLIB-level) ID */
26448  SPI_MODULE_ID spiId ;
26449  /* SPI Task Mode Type*/
26451  /* SPI Usage Mode Type */
26453  /* Allow SPI to run when CPU goes to idle mode*/
26454  bool allowIdleRun ;
26455  /* SPI Protocol Type */
26457  /* SPI Slave Mode SSx Pin Select */
26458  bool spiSlaveSSPin ;
26459  /* Framed mode Sync Pulse*/
26460  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26461  /* Framed Mode pulse polarity*/
26462  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26463  /* Framed Mode Pulse Direction*/
26464  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26465  /* Framed mode Pulse Edge*/
26466  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26467  /* Framed Mode Pulse width */
26468  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26469  /* Audio mode transmit mode*/
26470  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26471  /* Audio mode protocol mode*/
26472  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26473  /* Communication Width */
26474  SPI_COMMUNICATION_WIDTH commWidth ;
26475  /* SPI clock source which generates required baud rate.
26476  It can be either PBCLK or Reference Clock */
26477  SPI_BAUD_RATE_CLOCK baudClockSource ;
26478  /* when Baud rate clock source is peripheral clock, then this element is
26479  used to define which peripheral bus clock is used for this particular
26480  SPI instance. */
26481  CLK_BUSES_PERIPHERAL spiClk ;
26482  /* Baud Rate Value */
26483  uint32_t baudRate ;
26484  /* SPI Buffer Type */
26486  /* SPI Clock mode */
26488  /* SPI Input Sample Phase Selection */
26489  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26490  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26491  INT_SOURCE txInterruptSource ;
26492  /* Receive Interrupt Source for SPI module */
26493  INT_SOURCE rxInterruptSource ;
26494  /* Error Interrupt Source for SPI module */
26495  INT_SOURCE errInterruptSource ;
26496  /* While using standard buffer and polled mode how many transfers to do
26497  before yielding to other tasks*/
26498  uint8_t numTrfsSmPolled ;
26499  /* Dummy byte value which will be used for dummy transmission */
26500  uint32_t dummyByteValue ;
26501  /* This is the buffer queue size. This is the maximum
26502  number of transfer requests that driver will queue. */
26503  uint8_t queueSize ;
26504  /* This controls the minimum number of jobs that the driver will be able
26505  to accept without running out of memory. The driver will reserve this
26506  number of jobs from the global SPI queue so that it will always be available*/
26507  uint8_t jobQueueReserveSize ;
26508  /* This callback is fired when an operation is about to start on the
26509  SPI bus. This allows the user to set any pins that need to be set.
26510  This callback may be called from an ISR so should not include OSAL
26511  calls. The context parameter is the same one passed into the
26512  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26513  */
26515  /* This callback is fired when an operation has just completed on the
26516  SPI bus. This allows the user to set any pins that need to be set.
26517  This callback may be called from an ISR so should not include OSAL
26518  calls. The context parameter is the same one passed into the
26519  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26520  */
26522 } DRV_SPI_INIT ;
26523 // *****************************************************************************
26524 /* SPI Driver Client Specific Configuration
26525  Summary:
26526  Defines the data that can be changed per client.
26527  Description:
26528  This data type defines the data can be configured per client. This data can
26529  be per client, and overrides the configuration data contained inside of
26530  DRV_SPI_INIT.
26531  Remarks:
26532  None.
26533 */
26534 
26535 typedef
26536 struct _DRV_SPI_CLIENT_DATA
26537 {
26538  /* Baud Rate Value */
26539  uint32_t baudRate ;
26540  /* This callback is fired when an operation is about to start on the
26541  SPI bus. This allows the user to set any pins that need to be set.
26542  This callback may be called from an ISR so should not include OSAL
26543  calls. The context parameter is the same one passed into the
26544  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26545  */
26547  /* This callback is fired when an operation has just completed on the
26548  SPI bus. This allows the user to set any pins that need to be set.
26549  This callback may be called from an ISR so should not include OSAL
26550  calls. The context parameter is the same one passed into the
26551  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26552  */
26555 //DOM-IGNORE-BEGIN
26556 //DOM-IGNORE-END
26557  // #ifndef _DRV_SPI_DEFINITIONS_H
26558 /*******************************************************************************
26559  End of File
26560 */
26561 
26562 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26563 /* CLOSE_FILE Include File */
26564 
26565 // DOM-IGNORE-BEGIN
26566 // DOM-IGNORE-END
26567 // *****************************************************************************
26568 // *****************************************************************************
26569 // Section: Interface Routines - System Level
26570 // *****************************************************************************
26571 // *****************************************************************************
26572 // *****************************************************************************
26573 /* Function:
26574  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26575  const SYS_MODULE_INIT * const init )
26576  Summary:
26577  Initializes the SPI instance for the specified driver index.
26578  <p><b>Implementation:</b> Static/Dynamic</p>
26579  Description:
26580  This routine initializes the SPI driver instance for the specified driver
26581  index, making it ready for clients to open and use it. The initialization
26582  data is specified by the 'init' parameter. The initialization may fail if the
26583  number of driver objects allocated are insufficient or if the specified
26584  driver instance is already initialized. The driver instance index is
26585  independent of the SPI module ID. For example, driver instance 0 can be
26586  assigned to SPI2. If the driver is built statically, then some of the
26587  initialization parameters are overridden by configuration macros. Refer to
26588  the description of the DRV_SPI_INIT data structure for more details on
26589  which members on this data structure are overridden.
26590  Precondition:
26591  None.
26592  Parameters:
26593  index - Identifier for the instance to be initialized. Please note this
26594  is not the SPI id. The hardware SPI id is set in the initialization
26595  structure. This is the index of the driver index to use.
26596  init - Pointer to a data structure containing any data necessary to
26597  initialize the driver. If this pointer is NULL, the driver
26598  uses the static initialization override macros for each
26599  member of the initialization data structure.
26600  Returns:
26601  - If successful - returns a valid handle to a driver instance object
26602  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26603  Example:
26604  <code>
26605  DRV_SPI_INIT init;
26606  SYS_MODULE_OBJ objectHandle;
26607  // Populate the SPI initialization structure
26608  init.spiId = SPI_ID_1,
26609  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26610  init.spiMode = DRV_SPI_MODE_MASTER,
26611  init.allowIdleRun = false,
26612  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26613  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26614  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26615  init.spiClk = CLK_BUS_PERIPHERAL_2,
26616  init.baudRate = 10000000,
26617  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26618  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26619  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26620  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26621  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26622  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26623  init.dummyByteValue = 0xFF,
26624  init.queueSize = 10,
26625  init.jobQueueReserveSize = 1,
26626  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26627  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26628  {
26629  // Handle error
26630  }
26631  </code>
26632  Remarks:
26633  This routine must be called before any other SPI routine is called.
26634  This routine should only be called once during system initialization
26635  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26636  instance. This routine will NEVER block for hardware access.
26637 */
26638 
26639 SYS_MODULE_OBJ
26641  const SYS_MODULE_INDEX index ,
26642  const SYS_MODULE_INIT * const init ) ;
26643 //*************************************************************************
26644 /* Function:
26645  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26646  Summary:
26647  Deinitializes the specified instance of the SPI driver module.
26648  <p><b>Implementation:</b> Static/Dynamic</p>
26649  Description:
26650  Deinitializes the specified instance of the SPI driver module,
26651  disabling its operation (and any hardware) and invalidates all of the
26652  internal data.
26653  Precondition:
26654  Function DRV_SPI_Initialize must have been called before calling this
26655  routine and a valid SYS_MODULE_OBJ must have been returned.
26656  Parameters:
26657  object - Driver object handle, returned from DRV_SPI_Initialize
26658  Returns:
26659  None.
26660  Example:
26661  <code>
26662  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26663  SYS_STATUS status;
26664  DRV_SPI_Deinitialize ( object );
26665  status = DRV_SPI_Status( object );
26666  if( SYS_MODULE_UNINITIALIZED == status )
26667  {
26668  // Check again later if you need to know
26669  // when the driver is deinitialized.
26670  }
26671  </code>
26672  Remarks:
26673  Once the Initialize operation has been called, the De-initialize
26674  operation must be called before the Initialize operation can be called
26675  again.
26676  This function will NEVER block waiting for hardware. If the operation
26677  requires time to allow the hardware to complete, this will be reported
26678  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26679  to find out when the module is in the ready state.
26680 */
26681 
26682 void
26684  SYS_MODULE_OBJ object ) ;
26685 //**************************************************************************
26686 /* Function:
26687  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26688  Summary:
26689  Provides the current status of the SPI driver module.
26690  <p><b>Implementation:</b> Static/Dynamic</p>
26691  Description:
26692  This function provides the current status of the SPI driver module.
26693  Precondition:
26694  The DRV_SPI_Initialize function must have been called before calling
26695  this function.
26696  Parameters:
26697  object - Driver object handle, returned from DRV_SPI_Initialize
26698  Returns:
26699  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26700  system level operation and cannot start another
26701  Example:
26702  <code>
26703  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26704  SYS_STATUS status;
26705  status = DRV_SPI_Status( object );
26706  if( SYS_STATUS_READY != status )
26707  {
26708  // Handle error
26709  }
26710  </code>
26711  Remarks:
26712  Any value greater than SYS_STATUS_READY is also a normal running state
26713  in which the driver is ready to accept new operations.
26714  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26715  deinitialized
26716  This value is less than SYS_STATUS_ERROR.
26717  This function can be used to determine when any of the driver's module
26718  level operations has completed.
26719  If the status operation returns SYS_STATUS_BUSY, the previous operation
26720  has not yet completed. Once the status operation returns
26721  SYS_STATUS_READY, any previous operations have completed.
26722  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26723  that is also an error state.
26724  This function will NEVER block waiting for hardware.
26725  If the Status operation returns an error value, the error may be
26726  cleared by calling the reinitialize operation. If that fails, the
26727  deinitialize operation will need to be called, followed by the
26728  initialize operation to return to normal operations.
26729 */
26730 
26731 SYS_STATUS
26732  DRV_SPI_Status (
26733  SYS_MODULE_OBJ object ) ;
26734 // *****************************************************************************
26735 /* Function:
26736  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26737  Summary:
26738  Maintains the driver's state machine and implements its ISR.
26739  <p><b>Implementation:</b> Static/Dynamic</p>
26740  Description:
26741  This routine is used to maintain the driver's internal state
26742  machine and implement its transmit ISR for interrupt-driven implementations.
26743  In polling mode, this function should be called from the SYS_Tasks()
26744  function. In interrupt mode, this function should be called in the transmit
26745  interrupt service routine of the USART that is associated with this USART
26746  driver hardware instance.
26747  Precondition:
26748  The DRV_SPI_Initialize routine must have been called for the specified
26749  SPI driver instance.
26750  Parameters:
26751  object - Object handle for the specified driver instance (returned from
26752  DRV_SPI_Initialize)
26753  Returns:
26754  None.
26755  Example:
26756  <code>
26757  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26758  while( true )
26759  {
26760  DRV_SPI_Tasks ( object );
26761  // Do other tasks
26762  }
26763  </code>
26764  Remarks:
26765  This function is normally not called directly by an application. It is
26766  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26767  ISR.
26768  This function may execute in an ISR context and will never block or access any
26769  resources that may cause it to block.
26770 */
26771 
26772 void
26773  DRV_SPI_Tasks (
26774  SYS_MODULE_OBJ object ) ;
26775 // *****************************************************************************
26776 // *****************************************************************************
26777 // Section: Interface Routines - Client Level
26778 // *****************************************************************************
26779 // *****************************************************************************
26780 //**************************************************************************
26781 /* Function:
26782  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26783  const DRV_IO_INTENT ioIntent )
26784  Summary:
26785  Opens the specified SPI driver instance and returns a handle to it.
26786  <p><b>Implementation:</b> Static/Dynamic</p>
26787  Description:
26788  This routine opens the specified SPI driver instance and provides a
26789  handle that must be provided to all other client-level operations to
26790  identify the caller and the instance of the driver. The ioIntent
26791  parameter defines how the client interacts with this driver instance.
26792  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26793  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26794  able to write to the driver. If the ioIntent in
26795  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26796  write.
26797  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26798  exclusive access to this client. The driver cannot be opened by any
26799  other client.
26800  Precondition:
26801  The DRV_SPI_Initialize function must have been called before calling
26802  this function.
26803  Parameters:
26804  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26805  Please note this is not the SPI ID.
26806  ioIntent - Zero or more of the values from the enumeration
26807  DRV_IO_INTENT ORed together to indicate the intended use of
26808  the driver
26809  Returns:
26810  If successful, the routine returns a valid open-instance handle (a
26811  number identifying both the caller and the module instance).
26812  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26813  can occur when the following is true:
26814  * if the number of client objects allocated via
26815  DRV_SPI_INSTANCES_NUMBER is insufficient
26816  * if the client is trying to open the driver but driver has been
26817  opened exclusively by another client
26818  * if the driver hardware instance being opened is not initialized or
26819  is invalid
26820  Example:
26821  <code>
26822  DRV_HANDLE handle;
26823  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26824  if( DRV_HANDLE_INVALID == handle )
26825  {
26826  // Unable to open the driver
26827  }
26828  </code>
26829  Remarks:
26830  The handle returned is valid until the DRV_SPI_Close routine is
26831  called. This routine will NEVER block waiting for hardware. If the
26832  requested intent flags are not supported, the routine will return
26833  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26834  It should not be called in an ISR.
26835 */
26836 
26837 DRV_HANDLE
26838  DRV_SPI_Open (
26839  const SYS_MODULE_INDEX drvIndex ,
26840  const DRV_IO_INTENT ioIntent ) ;
26841 //**************************************************************************
26842 /* Function:
26843  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26844  const DRV_SPI_CLIENT_DATA * cfgData )
26845  Summary:
26846  Configures a SPI client with specific data.
26847  <p><b>Implementation:</b> Static/Dynamic</p>
26848  Description:
26849  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26850  Whenever a new SPI job is started these values will be used. Passing in NULL will
26851  reset the client back to configuration parameters passed to driver initialization.
26852  A zero in any of the structure elements will reset that specific configuration back
26853  to the driver default.
26854  Precondition:
26855  The DRV_SPI_Open function must have been called before calling
26856  this function.
26857  Parameters:
26858  handle - handle of the client returned by DRV_SPI_Open.
26859  cfgData - Client-specific configuration data.
26860  Returns:
26861  - If successful - the routing will return greater than or equal to zero
26862  - If an error occurs - the return value is negative
26863 */
26864 
26865 int32_t
26867  DRV_HANDLE handle ,
26868  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26869 // *****************************************************************************
26870 /* Function:
26871  void DRV_SPI_Close ( DRV_HANDLE handle )
26872  Summary:
26873  Closes an opened instance of the SPI driver.
26874  <p><b>Implementation:</b> Static/Dynamic</p>
26875  Description:
26876  This function closes an opened instance of the SPI driver, invalidating the
26877  handle.
26878  Precondition:
26879  The DRV_SPI_Initialize routine must have been called for the specified
26880  SPI driver instance.
26881  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26882  Parameters:
26883  handle - A valid open-instance handle, returned from the driver's
26884  open routine
26885  Returns:
26886  None.
26887  Example:
26888  <code>
26889  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26890  DRV_SPI_Close ( handle );
26891  </code>
26892  Remarks:
26893  After calling this routine, the handle passed in "handle" must not be used
26894  with any of the remaining driver routines. A new handle must be obtained by
26895  calling DRV_SPI_Open before the caller may use the driver again. This
26896  function is thread safe in a RTOS application.
26897  Note:
26898  Usually there is no need for the driver client to verify that the Close
26899  operation has completed.
26900 */
26901 
26902 void
26903  DRV_SPI_Close (
26904  DRV_HANDLE handle ) ;
26905 // *****************************************************************************
26906 // *****************************************************************************
26907 // Section: Interface Routines - Client level Read & Write APIs
26908 // *****************************************************************************
26909 // *****************************************************************************
26910 /* These are non-blocking APIs. It doesn't wait until the operation gets
26911  finished. The actual operation will happen it the task routine. The status of
26912  this operation can be monitored using DRV_SPI_BufferStatus function. In
26913  polling mode, User must ensure that the code gets time to execute the task
26914  routine. */
26915 //*******************************************************************************
26916 /* Function:
26917  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26918  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26919  void * context )
26920  Summary:
26921  Registers a buffer for a read operation. Actual transfer will happen in
26922  the Task function.
26923  <p><b>Implementation:</b> Static/Dynamic</p>
26924  Description:
26925  Registers a buffer for a read operation. Actual transfer will happen in
26926  the Task function. The status of this operation can be monitored using
26927  DRV_SPI_BufferStatus function. A optional callback can also be
26928  provided that will be called when the operation is complete.
26929  Precondition:
26930  The DRV_SPI_Initialize routine must have been called for the specified
26931  SPI driver instance.
26932  DRV_SPI_Open must have been called to obtain a valid opened device
26933  handle.
26934  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26935  in the DRV_SPI_Open call.
26936  Parameters:
26937  handle - A valid open-instance handle, returned from the driver's
26938  open routine
26939  rxBuffer - The buffer to which the data should be written to.
26940  size - Number of bytes to be read from the SPI bus.
26941  completeCB - Pointer to a function to be called when this queued operation is complete.
26942  context - unused by the driver but this is passed to the callback when it is called.
26943  Returns:
26944  If the buffer add request is successful, a valid buffer handle is returned.
26945  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26946  Example:
26947  <code>
26948  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26949  char myBuffer[MY_BUFFER_SIZE], state = 0;
26950  DRV_SPI_BUFFER_HANDLE bufferHandle;
26951  switch ( state )
26952  {
26953  case 0:
26954  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26955  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26956  {
26957  state++;
26958  }
26959  break;
26960  case 1:
26961  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26962  {
26963  state++;
26964  // All transmitter data has been sent successfully.
26965  }
26966  break;
26967  }
26968  </code>
26969  Remarks:
26970  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26971  instead of it.
26972  */
26973 
26976  DRV_HANDLE handle ,
26977  void * rxBuffer ,
26978  size_t size ,
26979  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26980  void * context ) ;
26981 //*******************************************************************************
26982 /* Function:
26983  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26984  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26985  void * context )
26986  Summary:
26987  Registers a buffer for a write operation. Actual transfer will happen
26988  in the Task function.
26989  <p><b>Implementation:</b> Static/Dynamic</p>
26990  Description:
26991  Registers a buffer for a write operation. Actual transfer will happen
26992  in the Task function. The status of this operation can be monitored
26993  using DRV_SPI_BufferStatus function. A optional callback can also be
26994  provided that will be called when the operation is complete.
26995  Precondition:
26996  The DRV_SPI_Initialize routine must have been called for the specified
26997  SPI driver instance.
26998  DRV_SPI_Open must have been called to obtain a valid opened device
26999  handle.
27000  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27001  in the DRV_SPI_Open call.
27002  Parameters:
27003  handle - A valid open-instance handle, returned from the driver's
27004  open routine
27005  txBuffer - The buffer which hold the data.
27006  size - Number of bytes to be written to the SPI bus.
27007  completeCB - Pointer to a function to be called when this queued operation is complete
27008  context - unused by the driver but this is passed to the callback when it is called
27009  Returns:
27010  If the buffer add request is successful, a valid buffer handle is returned.
27011  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27012  Example:
27013  <code>
27014  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27015  char myBuffer[MY_BUFFER_SIZE], state = 0;
27016  DRV_SPI_BUFFER_HANDLE bufferHandle;
27017  switch ( state )
27018  {
27019  case 0:
27020  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27021  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27022  {
27023  state++;
27024  }
27025  break;
27026  case 1:
27027  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27028  {
27029  state++;
27030  // All transmitter data has been sent successfully.
27031  }
27032  break;
27033  }
27034  </code>
27035  Remarks:
27036  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27037  instead of it.
27038 */
27039 
27042  DRV_HANDLE handle ,
27043  void * txBuffer ,
27044  size_t size ,
27045  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27046  void * context ) ;
27047 //*******************************************************************************
27048 /* Function:
27049  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27050  void *txBuffer, void *rxBuffer, size_t size, )
27051  Summary:
27052  Registers a buffer for a read and write operation. Actual transfer will
27053  happen in the Task function.
27054  <p><b>Implementation:</b> Static/Dynamic</p>
27055  Description:
27056  Registers a buffer for a read and write operation. Actual transfer will
27057  happen in the Task function. The status of this operation can be
27058  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27059  provided that will be called when the operation is complete.
27060  Precondition:
27061  The DRV_SPI_Initialize routine must have been called for the specified
27062  SPI driver instance.
27063  DRV_SPI_Open must have been called to obtain a valid opened device
27064  handle.
27065  Parameters:
27066  handle - A valid open-instance handle, returned from the driver's
27067  open routine
27068  txBuffer - The buffer which hold the data.
27069  txSize - Number of bytes to be written to the SPI bus.
27070  rxBuffer - The buffer to which the data should be written to.
27071  rxSize - Number of bytes to be read from the SPI bus
27072  completeCB - Pointer to a function to be called when this queued operation is complete
27073  context - unused by the driver but this is passed to the callback when it is called
27074  Returns:
27075  If the buffer add request is successful, a valid buffer handle is returned.
27076  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27077  Example:
27078  <code>
27079  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27080  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27081  DRV_SPI_BUFFER_HANDLE bufferHandle;
27082  switch ( state )
27083  {
27084  case 0:
27085  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27086  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27087  {
27088  state++;
27089  }
27090  break;
27091  case 1:
27092  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27093  {
27094  state++;
27095  // All transmitter data has been sent successfully.
27096  }
27097  break;
27098  }
27099  </code>
27100  Remarks:
27101  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27102  instead of it.
27103 */
27104 
27107  DRV_HANDLE handle ,
27108  void * txBuffer ,
27109  size_t txSize ,
27110  void * rxBuffer ,
27111  size_t rxSize ,
27112  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27113  void * context ) ;
27114 //*******************************************************************************
27115 /* Function:
27116  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27117  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27118  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27119  Summary:
27120  Registers a buffer for a read operation. Actual transfer will happen in
27121  the Task function.
27122  <p><b>Implementation:</b> Static/Dynamic</p>
27123  Description:
27124  Registers a buffer for a read operation. Actual transfer will happen in
27125  the Task function. The status of this operation can be monitored using
27126  DRV_SPI_BufferStatus function. A optional callback can also be
27127  provided that will be called when the operation is complete.
27128  Precondition:
27129  The DRV_SPI_Initialize routine must have been called for the specified
27130  SPI driver instance.
27131  DRV_SPI_Open must have been called to obtain a valid opened device
27132  handle.
27133  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27134  in the DRV_SPI_Open call.
27135  Parameters:
27136  handle - A valid open-instance handle, returned from the driver's
27137  open routine
27138  rxBuffer - The buffer to which the data should be written to.
27139  size - Number of bytes to be read from the SPI bus.
27140  completeCB - Pointer to a function to be called when this queued operation is complete
27141  context - unused by the driver but this is passed to the callback when it is called
27142  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27143  Returns:
27144  If the buffer add request is successful, a valid buffer handle is returned.
27145  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27146  Example:
27147  <code>
27148  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27149  char myBuffer[MY_BUFFER_SIZE], state = 0;
27150  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27151  switch ( state )
27152  {
27153  case 0:
27154  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27155  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27156  {
27157  state++;
27158  }
27159  break;
27160  case 1:
27161  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27162  {
27163  state++;
27164  // All transmitter data has been sent successfully.
27165  }
27166  break;
27167  }
27168  </code>
27169  Remarks:
27170  None.
27171  */
27172 
27175  DRV_HANDLE handle ,
27176  void * rxBuffer ,
27177  size_t size ,
27178  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27179  void * context ,
27180  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27181 //*******************************************************************************
27182 /* Function:
27183  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27184  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27185  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27186  Summary:
27187  Registers a buffer for a write operation. Actual transfer will happen
27188  in the Task function.
27189  <p><b>Implementation:</b> Static/Dynamic</p>
27190  Description:
27191  Registers a buffer for a write operation. Actual transfer will happen
27192  in the Task function. The status of this operation can be monitored
27193  using DRV_SPI_BufferStatus function. A optional callback can also be
27194  provided that will be called when the operation is complete.
27195  Precondition:
27196  The DRV_SPI_Initialize routine must have been called for the specified
27197  SPI driver instance.
27198  DRV_SPI_Open must have been called to obtain a valid opened device
27199  handle.
27200  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27201  in the DRV_SPI_Open call.
27202  Parameters:
27203  handle - A valid open-instance handle, returned from the driver's
27204  open routine
27205  txBuffer - The buffer which hold the data.
27206  size - Number of bytes to be written to the SPI bus.
27207  completeCB - Pointer to a function to be called when this queued operation is complete
27208  context - unused by the driver but this is passed to the callback when it is called
27209  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27210  Returns:
27211  If the buffer add request is successful, a valid buffer handle is returned.
27212  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27213  Example:
27214  <code>
27215  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27216  char myBuffer[MY_BUFFER_SIZE], state = 0;
27217  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27218  switch ( state )
27219  {
27220  case 0:
27221  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27222  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27223  {
27224  state++;
27225  }
27226  break;
27227  case 1:
27228  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27229  {
27230  state++;
27231  // All transmitter data has been sent successfully.
27232  }
27233  break;
27234  }
27235  </code>
27236  Remarks:
27237  None.
27238 */
27239 
27242  DRV_HANDLE handle ,
27243  void * txBuffer ,
27244  size_t size ,
27245  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27246  void * context ,
27247  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27248 //*******************************************************************************
27249 /* Function:
27250  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27251  void *txBuffer, void *rxBuffer, size_t size,
27252  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27253  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27254  Summary:
27255  Registers a buffer for a read and write operation. Actual transfer will
27256  happen in the Task function.
27257  <p><b>Implementation:</b> Static/Dynamic</p>
27258  Description:
27259  Registers a buffer for a read and write operation. Actual transfer will
27260  happen in the Task function. The status of this operation can be
27261  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27262  provided that will be called when the operation is complete.
27263  Precondition:
27264  The DRV_SPI_Initialize routine must have been called for the specified
27265  SPI driver instance.
27266  DRV_SPI_Open must have been called to obtain a valid opened device
27267  handle.
27268  Parameters:
27269  handle - A valid open-instance handle, returned from the driver's
27270  open routine
27271  txBuffer - The buffer which hold the data.
27272  txSize - Number of bytes to be written to the SPI bus.
27273  rxBuffer - The buffer to which the data should be written to.
27274  rxSize - Number of bytes to be read from the SPI bus
27275  completeCB - Pointer to a function to be called when this queued operation is complete
27276  context - unused by the driver but this is passed to the callback when it is called
27277  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27278  Returns:
27279  If the buffer add request is successful, a valid buffer handle is returned.
27280  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27281  Example:
27282  <code>
27283  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27284  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27285  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27286  switch ( state )
27287  {
27288  case 0:
27289  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27290  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27291  {
27292  state++;
27293  }
27294  break;
27295  case 1:
27296  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27297  {
27298  state++;
27299  // All transmitter data has been sent successfully.
27300  }
27301  break;
27302  }
27303  </code>
27304  Remarks:
27305  None.
27306 */
27307 
27310  DRV_HANDLE handle ,
27311  void * txBuffer ,
27312  size_t txSize ,
27313  void * rxBuffer ,
27314  size_t rxSize ,
27315  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27316  void * context ,
27317  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27318 // *****************************************************************************
27319 /* Function:
27320  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27321  Summary:
27322  Returns the transmitter and receiver transfer status.
27323  <p><b>Implementation:</b> Static/Dynamic</p>
27324  Description:
27325  This returns the transmitter and receiver transfer status.
27326  Precondition:
27327  The DRV_SPI_Initialize routine must have been called for the specified
27328  SPI driver instance.
27329  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27330  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27331  the buffer handle associated with that transfer.
27332  Parameters:
27333  bufferHandle - A valid buffer handle, returned from the driver's
27334  data transfer routine
27335  Returns:
27336  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27337  transfer.
27338  Example:
27339  <code>
27340  // Buffer handle returned from the data transfer function
27341  DRV_SPI_BUFFER_HANDLE bufferHandle;
27342  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27343  {
27344  // All transmitter data has been sent.
27345  }
27346  </code>
27347  Remarks:
27348  The returned status may contain a value with more than one of the bits
27349  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27350  should perform an AND with the bit of interest and verify if the
27351  result is non-zero (as shown in the example) to verify the desired status
27352  bit.
27353 */
27354 
27357  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27358 // *****************************************************************************
27359 /* Function:
27360  bool DRV_SPIn_ReceiverBufferIsFull(void)
27361  Summary:
27362  Returns the receive buffer status. 'n' represents the instance of the
27363  SPI driver used.
27364  <p><b>Implementation:</b> Static</p>
27365  Description:
27366  This function returns the receive buffer status (full/empty).
27367  Precondition:
27368  None.
27369  Parameters:
27370  None.
27371  Returns:
27372  Receive Buffer Status
27373  - 1 - Full
27374  - 0 - Empty
27375  Example:
27376  <code>
27377  bool rxBufStat;
27378  // Using instance 1 of SPI driver, that is n = 1
27379  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27380  if (rxBufStat)
27381  {
27382  ...
27383  }
27384  </code>
27385  Remarks:
27386  None.
27387 */
27388 
27389 bool
27391 // *****************************************************************************
27392 /* Function:
27393  bool DRV_SPIn_TransmitterBufferIsFull(void)
27394  Summary:
27395  Returns the transmit buffer status. 'n' represents the instance of the
27396  SPI driver used.
27397  <p><b>Implementation:</b> Static</p>
27398  Description:
27399  This function returns the transmit buffer status (full/empty).
27400  Precondition:
27401  None.
27402  Parameters:
27403  None.
27404  Returns:
27405  Transmit Buffer Status
27406  - 1 - Full
27407  - 0 - Empty
27408  Example:
27409  <code>
27410  bool txBufStat;
27411  // Using instance 1 of SPI driver, that is n = 1
27412  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27413  if (txBufStat)
27414  {
27415  ...
27416  }
27417  </code>
27418  Remarks:
27419  None.
27420 */
27421 
27422 bool
27424 //DOM-IGNORE-BEGIN
27425 //DOM-IGNORE-END
27426  // #ifndef _DRV_SPI_H
27427 /*******************************************************************************
27428  End of File
27429 */
27430 
27431 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27432 /* CLOSE_FILE Include File */
27433 
27434 #include "driver/usb/usbhs/drv_usbhs.h"
27435 #include "usb/usb_device.h"
27436 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27437 /**************************************************************************************/
27438 /* LDRA_INSPECTED 110 S
27439 */
27455 /**************************************************************************************/
27456 #ifndef APP_H /* Guard against multiple inclusion.*/
27457 #define APP_H
27458 /**************************************************************************************/
27459 /* ************************************************************************************/
27460 /* Section: Included Files */
27461 /**************************************************************************************/
27462 /**************************************************************************************/
27463 #include <stdint.h>
27464 /**************************************************************************************/
27465 /**************************************************************************************/
27466 /* Section: Data Types */
27467 /**************************************************************************************/
27468 /**************************************************************************************/
27469 /**************************************************************************************/
27470 /* APP_DATA
27471  Summary:
27472  Holds APP_DATA used for the APP tasks.
27473  Description:
27474  Holds APP_DATA used for the APP tasks. The variables
27475  used are stored here.
27476  Remarks:
27477  None
27478  */
27479 
27480 typedef
27481  struct
27482  {
27483  uint8_t RevNumber ;
27484  } APP_DATA ;
27485 
27486 extern APP_DATA
27487  APP ;
27488 /**************************************************************************************/
27489 /**************************************************************************************/
27490 /* Section: Application Initialization and State Machine Functions */
27491 /**************************************************************************************/
27492 /**************************************************************************************/
27493 /*!*************************************************************************************
27494  Function:
27495  void APP_Initialize(void)
27496  Summary:
27497  Autonomous tool application initialization routine.
27498  Description:
27499  This function initializes the application. It places the
27500  application in its initial state and prepares it to run so that its
27501  APP_Tasks function can be called.
27502  Precondition:
27503  All other system initialization routines should be called before calling
27504  this routine (in "SYS_Initialize").
27505  Parameters:
27506  None.
27507  Returns:
27508  None.
27509  Example:
27510  APP_Initialize()
27511  Remarks:
27512  This routine must be called from the main function.
27513 */
27514 
27515 void
27516  APP_Initialize ( void ) ;
27517 /*!*************************************************************************************
27518  Function:
27519  void APP_Tasks(void)
27520  Summary:
27521  Application tasks function
27522  Description:
27523  This function is the main application's tasks function. It contains the various
27524  tasks that are maintained during the operation of the shooting panel.
27525  Precondition:
27526  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27527  should be called before calling this.
27528  Parameters:
27529  None.
27530  Returns:
27531  None.
27532  Example:
27533  APP_Tasks()
27534  Remarks:
27535  This routine must be called from the main() routine.
27536  */
27537 
27538 void
27539  APP_Tasks ( void ) ;
27540  /* APP_H */
27541 /***************************************************************************************
27542  End of File
27543  */
27544 
27545 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27546 /* CLOSE_FILE Include File */
27547 
27548 // DOM-IGNORE-BEGIN
27549 // DOM-IGNORE-END
27550 // *****************************************************************************
27551 // *****************************************************************************
27552 // Section: Type Definitions
27553 // *****************************************************************************
27554 // *****************************************************************************
27555 // *****************************************************************************
27556 /* System Objects
27557  Summary:
27558  Structure holding the system's object handles
27559  Description:
27560  This structure contains the object handles for all objects in the
27561  MPLAB Harmony project's system configuration.
27562  Remarks:
27563  These handles are returned from the "Initialize" functions for each module
27564  and must be passed into the "Tasks" function for each module.
27565 */
27566 
27567 typedef
27568  struct
27569  {
27570  SYS_MODULE_OBJ sysTmr ;
27571  SYS_MODULE_OBJ drvTmr0 ;
27572  SYS_MODULE_OBJ drvTmr1 ;
27573  SYS_MODULE_OBJ drvTmr2 ;
27574  SYS_MODULE_OBJ drvTmr3 ;
27575  SYS_MODULE_OBJ drvTmr4 ;
27576  SYS_MODULE_OBJ drvUsart0 ;
27577  SYS_MODULE_OBJ drvPMP0 ;
27578  /*** SPI Object for Index 0 ***/
27579  SYS_MODULE_OBJ spiObjectIdx0 ;
27580  /*** SPI Object for Index 1 ***/
27581  SYS_MODULE_OBJ spiObjectIdx1 ;
27582  /*** SPI Object for Index 2 ***/
27583  SYS_MODULE_OBJ spiObjectIdx2 ;
27584  SYS_MODULE_OBJ drvUSBObject ;
27585  SYS_MODULE_OBJ usbDevObject0 ;
27586  } SYSTEM_OBJECTS ;
27587 // *****************************************************************************
27588 // *****************************************************************************
27589 // Section: extern declarations
27590 // *****************************************************************************
27591 // *****************************************************************************
27592 
27593 extern SYSTEM_OBJECTS
27594  sysObj ;
27595 //DOM-IGNORE-BEGIN
27596 //DOM-IGNORE-END
27597  /* _SYS_DEFINITIONS_H */
27598 /*******************************************************************************
27599  End of File
27600 */
27601 
27602 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27603 /* CLOSE_FILE Include File */
27604 
27605 
27606 typedef
27607 float
27609 /**************************************************************************************/
27610 /**************************************************************************************/
27611 /* Section: Data Types */
27612 /**************************************************************************************/
27613 /**************************************************************************************/
27614 
27615 typedef
27616  enum
27617  {
27624  } WL_CPS_STATES ;
27625 
27626 typedef
27627  struct
27628  {
27629  WL_CPS_STATES state ;
27630  DRV_HANDLE spi_cont_pot ;
27631  DRV_SPI_BUFFER_HANDLE bufferHandle ;
27632  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
27633  int8_t v_adj [ 1 ] ;
27634  uint16_t voltage ;
27635  uint16_t voltage_limit ;
27636  uint16_t current ;
27637  uint16_t max_current ;
27638  uint8_t current_limit ;
27639  uint8_t upper_current_limit ;
27640  uint8_t over_current_count ;
27641  float32_t volt_constant ;
27642  float32_t current_constant ;
27643  bool new_voltage_flag ;
27644  bool new_current_flag ;
27645  bool spi_write_complete_flag ;
27646  bool spi_sent_flag ;
27647  uint8_t avg_count ;
27648  uint8_t avg_count_max ;
27649  uint16_t current_array [ 5 ] ;
27650  uint16_t avg_current ;
27651  uint8_t overvoltage_count ;
27652  } WL_CPS_DATA ;
27653 
27654 extern WL_CPS_DATA
27655  WL_CPS ;
27656 /**************************************************************************************/
27657 /**************************************************************************************/
27658 /* Section: Local Functions */
27659 /**************************************************************************************/
27660 /**************************************************************************************/
27661 /*!*************************************************************************************
27662  Function:
27663  static void Init_WL_CPS( void )
27664  Summary:
27665  This function initializes the wire-line communication power supply parameters.
27666  Description:
27667  This function initializes the wire-line communication power supply parameters.
27668  Initial limits, flags and constants are set here.
27669 
27670  Precondition:
27671  None.
27672  Parameters:
27673  None.
27674  Returns
27675  None.
27676 
27677  Remarks
27678  None.
27679 
27680  Example:
27681  Init_WL_CPS()
27682  */
27683 
27684 static void
27685  Init_WL_CPS ( void ) ;
27686 /*!*************************************************************************************
27687  Function:
27688  static void Read_WL_CPS_V_I( void )
27689  Summary:
27690  This task reads the voltage and current from the wire line communication power
27691  supply(WL_CPS). It also tracks the maximum current from the supply.
27692  Description:
27693  This task reads the voltage and current from the wire line communication power
27694  supply(WL_CPS). It also tracks the maximum current from the supply.
27695 
27696  Precondition:
27697  None.
27698  Parameters:
27699  None.
27700  Returns
27701  None.
27702 
27703  Remarks
27704  None.
27705 
27706  Example:
27707  Read_WL_CPS_V_I( )
27708  */
27709 
27710 static void
27711  Read_WL_CPS_V_I ( void ) ;
27712 /*!*************************************************************************************
27713  Function:
27714  static void Check_WL_CPS_Over_Current( void )
27715  Summary:
27716  This function checks if the WL_CPS current has exceeded the current limit.
27717  Description:
27718  This function checks if the WL_CPS current has exceeded the current limit. If
27719  the current has exceeded the limit for five readings, the supply is turned off.
27720 
27721  Precondition:
27722  None.
27723  Parameters:
27724  None.
27725  Returns
27726  None.
27727 
27728  Remarks
27729  None.
27730 
27731  Example:
27732  Check_WL_CPS_Over_Current( )
27733  */
27734 
27735 static void
27736  Check_WL_CPS_Over_Current ( void ) ;
27737 /*!*************************************************************************************
27738  Function:
27739  void Set_WL_CPS_CurrentLimit(uint8_t value)
27740  Summary:
27741  This function sets the WL_CPS current limit.
27742  Description:
27743  This function sets the WL_CPS current limit. It must be less than or equal to
27744  the upper current limit. This parameter is used in the over current check.
27745 
27746  Precondition:
27747  None.
27748  Parameters:
27749  uint8_t value - the current limit in mA.
27750  Returns
27751  None.
27752 
27753  Remarks
27754  None.
27755 
27756  Example:
27757  Set_WL_CPS_CurrentLimit(70)
27758  */
27759 
27760 void
27762  uint8_t value ) ;
27763 /*!*************************************************************************************
27764  Function:
27765  void Adjust_WL_CPS_Voltage(uint8_t target)
27766  Summary:
27767  This function adjusts the WL_CPS to the desired voltage.
27768  Description:
27769  This function adjusts the WL_CPS to the desired voltage. The value is checked
27770  to ensure it is within the adjustable limits of 15 to 64 VDC. That voltage is
27771  converted to a table value that contains the appropriate pot settings for a
27772  given voltage. The pot settings is then transmitted via SPI port to the
27773  WL_CPS control pot.
27774 
27775  Precondition:
27776  None.
27777  Parameters:
27778  uint8_t target - desired voltage between 15 and 64V.
27779  Returns
27780  None.
27781 
27782  Remarks
27783  None.
27784 
27785  Example:
27786  Adjust_WL_CPS_Voltage(30)
27787  */
27788 
27789 void
27791  uint8_t target ) ;
27792 /**************************************************************************************/
27793 /**************************************************************************************/
27794 /* State Machine Functions */
27795 /**************************************************************************************/
27796 /**************************************************************************************/
27797 /*!*************************************************************************************
27798  Function:
27799  *
27800  void WL_CPS_Tasks(void)
27801  Summary:
27802  WL_CPS_Tasks function
27803  Description:
27804  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
27805  machine and core logic. This machine is used to monitor the wire-line communication
27806  power supply (WL_CPS) voltage and current and will set flags when those limits
27807  are exceeded.
27808  Precondition:
27809  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27810  should be called before calling this.
27811  Parameters:
27812  None.
27813  Returns:
27814  None.
27815  Remarks:
27816  This routine must be called from the APP_Tasks() routine.
27817  Example:
27818  WL_CPS_Tasks()
27819  */
27820 
27821 void
27822  WL_CPS_Tasks ( void ) ;
27823  /* WL_CPS_H */
27824 /***************************************************************************************
27825  End of File
27826  */
27827 
27828 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h*/
27829 /* CLOSE_FILE Include File */
27830 
27831 #include "app.h"
27832 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h */
27833 /**************************************************************************************/
27847 /**************************************************************************************/
27848 #ifndef ADC_H /* Guard against multiple inclusion.*/
27849 #define ADC_H
27850 /**************************************************************************************/
27851 /**************************************************************************************/
27852 /* Section: Included Files */
27853 /**************************************************************************************/
27854 /**************************************************************************************/
27855 #include <stdint.h>
27856 #include <stdbool.h>
27857 /**************************************************************************************/
27858 /**************************************************************************************/
27859 /* Section: Data Types */
27860 /**************************************************************************************/
27861 /**************************************************************************************/
27862 /**************************************************************************************/
27863 /* ADC states
27864  Summary:
27865  ADC states enumeration
27866  Description:
27867  This enumeration defines the valid ADC states. These states
27868  determine the behavior of the ADC state machine at various times.
27869 */
27870 
27871 typedef
27872  enum
27873  {
27878  } ADC_STATES ;
27879 /**************************************************************************************/
27880 /* ADC_DATA
27881  Summary:
27882  Holds ADC_DATA used for the ADC tasks.
27883  Description:
27884  Holds ADC_DATA used for the ADC tasks. The state machine and variables
27885  used to control ADC functions are stored here.
27886  Remarks:
27887  None
27888  */
27889 
27890 typedef
27891  struct /* This structure collects the variables and states required for these*/
27892  {
27893  /* functions to operate.*/
27894  ADC_STATES state ;
27895  uint16_t hvps_i ;
27896  uint16_t hvps_cont ;
27897  uint16_t wl_cps_i ;
27898  uint16_t wl_cps_v ;
27899  uint16_t wl_sps_i_cf ;
27900  uint16_t wl_sps_i ;
27901  bool tick ;
27902  bool ADCInt ;
27903  } ADC_DATA ;
27904 
27905 extern ADC_DATA
27906  ADC ;
27907 /**************************************************************************************/
27908 /**************************************************************************************/
27909 /* State Machine Functions */
27910 /**************************************************************************************/
27911 /**************************************************************************************/
27912 /*!*************************************************************************************
27913  Function:
27914  void ADC_Tasks(void)
27915  Summary:
27916  ADC tasks function
27917  Description:
27918  This routine is the ADC tasks function. It defines the ADC's state machine and
27919  core logic. This machine initializes the Timer and ADCs used to digitize signal
27920  inputs. Once the timer and ADCs are started, this machine is set to idle and the
27921  the updated ADC values are retrieved in the system interrupt routine.
27922  Precondition:
27923  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27924  should be called before calling this.
27925  Parameters:
27926  None.
27927  Returns:
27928  None.
27929  Example:
27930  ADC_Tasks()
27931 
27932  Remarks:
27933  This routine must be called from the APP_Tasks() routine.
27934  */
27935 
27936 void
27937  ADC_Tasks ( void ) ;
27938  /* ADC_H */
27939 /***************************************************************************************
27940  End of File
27941  */
27942 
27943 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h*/
27944 /* CLOSE_FILE Include File */
27945 
27946 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h */
27947 /**************************************************************************************/
27964 /**************************************************************************************/
27965 #ifndef STATUSST_H /* Guard against multiple inclusion */
27966 #define STATUSST_H
27967 /**************************************************************************************/
27968 /**************************************************************************************/
27969 /* Section: Included Files */
27970 /**************************************************************************************/
27971 /**************************************************************************************/
27972 #include <stdbool.h>
27973 #include <stdint.h>
27974 /*typedef unsigned char uchar8_t*/
27975 /**************************************************************************************/
27976 /**************************************************************************************/
27977 /* Section: Interface Functions */
27978 /**************************************************************************************/
27979 /**************************************************************************************/
27980 /*!*************************************************************************************
27981  Function:
27982  void Set_Status(uint8_t bitposn)
27983  Summary:
27984  This function sets the desired bit to a one in the PIB status register.
27985  Description:
27986  This function sets the desired bit to a one in the PIB status register. This is
27987  called by various functions to indicate a command result or switch setting.
27988 
27989  Precondition:
27990  None.
27991  Parameters:
27992  uint8_t bitposn - the desired bit position in the PIB status register.
27993  Returns
27994  None.
27995 
27996  Remarks:
27997  None.
27998 
27999  Example:
28000  Set_Status(6)
28001  */
28002 
28003 void
28004  Set_Status (
28005  uint8_t bitposn ) ;
28006 /*!*************************************************************************************
28007  Function:
28008  void Clear_Status(unsigned short bitposn)
28009  Summary:
28010  This function sets the desired bit to a zero in the PIB status register.
28011  Description:
28012  This function sets the desired bit to a zero in the PIB status register. This is
28013  called by various functions to indicate a command result or switch setting.
28014 
28015  Precondition:
28016  None.
28017  Parameters:
28018  uint8_t bitposn - the desired bit position in the PIB status register.
28019  Returns
28020  None.
28021 
28022  Remarks:
28023  None.
28024 
28025  Example:
28026  ClearStatus(7)
28027  */
28028 
28029 void
28030  Clear_Status (
28031  uint8_t bitposn ) ;
28032 /*!*************************************************************************************
28033  Function:
28034  void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1 )
28035  Summary:
28036  Function to prepare the protocol A response.
28037  Description:
28038  Function to prepare the protocol A response. The return message is seven bytes.
28039  the first byte is the command that was sent. the next two bytes are the PIB status
28040  register. The next three bytes can contain two - 12 bit data fields. The data is
28041  then transferred to the TxFifo. The CRC for the return message is calculated
28042  and placed in the last byte.
28043 
28044  Precondition:
28045  None.
28046  Parameters:
28047  uint8_t byte - The command byte.
28048  uint16_t data2 - a 12 bit data field.
28049  uint16_t data1 - 1 12 bit data field.
28050  Returns
28051  None.
28052 
28053  Remarks:
28054  None.
28055 
28056  Example:
28057  Prepare_Return_A(CMD.COMMAND[ 0 ], 0, 0)
28058  */
28059 
28060 void
28062  uint8_t byte ,
28063  uint16_t data2 ,
28064  uint16_t data1 ) ;
28065 /*!*************************************************************************************
28066  Function:
28067  void Prepare_Return_B(uint8_t byt[] )
28068  Summary:
28069  Function to prepare the protocol B response.
28070  Description:
28071  Function to prepare the protocol B response. The return message is seven bytes.
28072  the first byte is the command that was sent. the next two bytes are the PIB status
28073  register. The next three bytes can contain a 12 bit Switch status register,
28074  a four bit StateID and an 8 bit Switch ID. The data is then transferred to the
28075  TxFifo. The CRC for the return message is calculated and placed in the last byte.
28076 
28077  Precondition:
28078  None.
28079  Parameters:
28080  uint8_t byt[] - Three received bytes from a PerfSwitch.
28081  Returns
28082  None.
28083 
28084  Remarks:
28085  None.
28086 
28087  Example:
28088  Prepare_Return_B( MAN.msg )
28089  */
28090 
28091 void
28093  uint8_t byt [] ) ;
28094  /* STATUSST_H */
28095 /***************************************************************************************
28096  End of File
28097  */
28098 
28099 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h*/
28100 /* CLOSE_FILE Include File */
28101 
28102 #include <math.h>
28103 /**************************************************************************************/
28104 /**************************************************************************************/
28105 /* Section: Structure Data and Local Variables */
28106 /**************************************************************************************/
28107 /**************************************************************************************/
28108 /**************************************************************************************/
28109 /* WL_CPS Data
28110  Summary:
28111  These structures hold the required states and variables to perform the WL_CPS tasks.
28112  Description:
28113  These structures hold the required states and variables to perform the WL_CPS tasks.
28114  These are here to link these structures for use by the local functions.
28115 
28116  Remarks:
28117  These are defined in wl_cps.h
28118 */
28119 
28122 
28123 static WL_CPS_STATES
28125 /**************************************************************************************/
28126 /**************************************************************************************/
28127 /* Section: Defines */
28128 /**************************************************************************************/
28129 /**************************************************************************************/
28130 #define MIN_WL_COMM_PS_ADJ 15
28131 /**************************************************************************************/
28132 /**************************************************************************************/
28133 /* Section: SPI Callback Functions */
28134 /**************************************************************************************/
28135 /**************************************************************************************/
28136 
28137 void
28139  DRV_SPI_BUFFER_EVENT event ,
28140  DRV_SPI_BUFFER_HANDLE bufferHandle ,
28141  void * context )
28142  {
28143  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
28144  if
28145  (
28147  )
28148  {
28149  ((int)(bitmapstruct.element1 |= (1 << 29))); /* 1 */
28150  {
28152  }
28153  } else ((int)(bitmapstruct.element1 |= (1 << 30))); /* 4 */
28154  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 30 */
28155  wl_cps_51zqendz ( 64 ) ; /* 30 */
28156  }
28157 /**************************************************************************************/
28158 /**************************************************************************************/
28159 /* Section: Local Variables */
28160 /**************************************************************************************/
28161 /**************************************************************************************/
28162 /**************************************************************************************/
28163 /**************************************************************************************/
28164 /* Section: State Machine Functions */
28165 /**************************************************************************************/
28166 /**************************************************************************************/
28167 /***************************************************************************************
28168  Function:
28169  void WL_CPS_Tasks ( void )
28170  Summary:
28171  This routine is the WL_CPS_Tasks function. It defines the (WL_CPS) state machine
28172  and core logic. This task monitors the WL_CPS voltage and current.
28173  Remarks:
28174  Refer to the wl_cps.h interface header for function usage details.
28175  */
28176 
28177 void
28178  WL_CPS_Tasks ( void )
28179  {
28180  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 0))); /* 37 */
28181  switch (
28182  ( ( int )( /* 29 */
28183  WL_CPS.state
28184  ))*
28185  ((bitmapstruct.element2 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ) /* 19 */
28186  ) /* Check the machines current state.*/
28187  {
28188  case WL_CPS_STATE_INIT :
28189  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 2) : 0)), 1 ); /* 41 */
28190  /* The machines initial state.*/
28191  {
28192  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 23 */
28193 
28194  Init_WL_CPS () ; /* Initialize parameters.*/
28195  WL_CPS.state = WL_CPS_STATE_INIT_SPI_WL_CPS ; /* Move on to open the SPI port and initialize WL_CPS.*/
28196  }
28197  ((int)(bitmapstruct.element2 |= (1 << 4))); /* 16 */
28198  goto l128027 ;
28200  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ); /* 41 */
28201  /* Open the SPI control pot port and initialize WL_CPS to minimum voltage.*/
28202  {
28203  if
28204  (
28205  WL_CPS.spi_cont_pot == (
28206  (
28207  ( DRV_HANDLE ) - 1 ) )
28208  ) /* If the SPI port for the WL_CPS control pot had not been opened,*/
28209  {
28210  ((int)(bitmapstruct.element2 |= (1 << 6))); /* 1 */
28211  {
28212  WL_CPS.spi_cont_pot = DRV_SPI_Open ( 1 , /* open the port.*/
28214  }
28215  } else ((int)(bitmapstruct.element2 |= (1 << 7))); /* 4 */
28216  if
28217  (
28218  WL_CPS.spi_cont_pot != (
28219  (
28220  ( DRV_HANDLE ) - 1 ) )
28221  ) /* If the SPI port for the WL_CPS control pot has been opened,*/
28222  {
28223  ((int)(bitmapstruct.element2 |= (1 << 8))); /* 1 */
28224  {
28225  ((int)(bitmapstruct.element2 |= (1 << 9))); /* 23 */
28226 
28228  30 ) ; /* Set the WL_CPS to 30VDC.*/
28229  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* Ensure the supply is off.*/
28230  WL_CPS.state = WL_CPS_STATE_SPI_WRITE_WAIT ; /* Move on to wait for SPI write to complete.*/
28231  }
28232  } else ((int)(bitmapstruct.element2 |= (1 << 10))); /* 4 */
28233  }
28234  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 16 */
28235  goto l128027 ;
28237  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 12) : 0)), 1 ); /* 41 */
28238  {
28239  if
28240  (
28242  ) /* If the SPI port write has completed,*/
28243  {
28244  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 1 */
28245  {
28246  WL_CPS.spi_write_complete_flag = false ; /* reset the flag and*/
28247  WL_CPS.state = WL_CPS_STATE_READ_V_I ; /* move on to read the WL_CPS voltage and current.*/
28248  }
28249  } else ((int)(bitmapstruct.element2 |= (1 << 14))); /* 4 */
28250  }
28251  ((int)(bitmapstruct.element2 |= (1 << 15))); /* 16 */
28252  goto l128027 ;
28253  case WL_CPS_STATE_READ_V_I :
28254  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 16) : 0)), 1 ); /* 41 */
28255  {
28256  if
28257  ( /* 50 */
28258  (
28259 
28260  ( /* 51 */
28261  (
28262  WL_CPS.new_voltage_flag == true
28263  )
28264  ? (bitmapstruct.element2 |= (1 << 18 ), 1)
28265  : (bitmapstruct.element2 |= (1 << 17 ), 0) ) /* 54 */
28266  ||
28267  ( WL_CPS.new_current_flag == true )
28268  ) /* If new values are available,*/
28269  ) /* 1 */
28270  {
28271  ((int)(bitmapstruct.element2 |= (1 << 19))); /* 1 */
28272  {
28273  ((int)(bitmapstruct.element2 |= (1 << 20))); /* 23 */
28274 
28275  Read_WL_CPS_V_I () ; /* read the WL_CPS voltage and current and check for a maximum current.*/
28276  WL_CPS.state = WL_CPS_STATE_CHECK_OVERCURRENT ; /* Move on to check for an over current condition.*/
28277  }
28278  } else ((int)(bitmapstruct.element2 |= (1 << 21))); /* 4 */
28279  }
28280  ((int)(bitmapstruct.element2 |= (1 << 22))); /* 16 */
28281  goto l128027 ;
28283  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
28284  {
28285  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 23 */
28286 
28287  Check_WL_CPS_Over_Current () ; /* Check for an over current condition.*/
28288  WL_CPS.state = WL_CPS_STATE_CHECK_OVERVOLTAGE ; /* Move on to read the next available voltage and current.*/
28289  }
28290  ((int)(bitmapstruct.element2 |= (1 << 25))); /* 16 */
28291  goto l128027 ;
28293  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 26) : 0)), 1 ); /* 41 */
28294  {
28295  if
28296  (
28298  )
28299  {
28300  ((int)(bitmapstruct.element2 |= (1 << 27))); /* 1 */
28301  {
28302  WL_CPS.overvoltage_count ++ ; /* Increment occurrence count.*/
28303  if
28304  (
28306  ) /* If it exceeds limit 5 times in a row,*/
28307  {
28308  ((int)(bitmapstruct.element2 |= (1 << 28))); /* 1 */
28309  {
28310  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* turn the WL_CPS supply off.*/
28311  Set_Status ( 4 ) ;/* Set status bit to indicate WL_CPS overvoltage.*/
28312  }
28313  } else ((int)(bitmapstruct.element2 |= (1 << 29))); /* 4 */
28314  }
28315  ((int)(bitmapstruct.element2 |= (1 << 30))); /* 3 */
28316  }
28317  else
28318  {
28319  ((int)(bitmapstruct.element2 |= (1 << 31))); /* 2 */
28320  {
28321  WL_CPS.overvoltage_count = 0U ; /* Reset Count.*/
28322  }
28323  }
28324  WL_CPS.state = WL_CPS_STATE_READ_V_I ; /* Move on to read the next available voltage and current.*/
28325  }
28326  ((int)(bitmapstruct.element3 |= (1 << 0))); /* 16 */
28327  goto l128027 ;
28328  default :
28329  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
28330  {
28331  /*Comment.*/
28332  }
28333  ((int)(bitmapstruct.element3 |= (1 << 2))); /* 16 */
28334  goto l128027 ;
28335  }
28336 l128027 :
28337  ; /* 18 */
28338  ((int)(bitmapstruct.element3 |= (1 << 3))); /* 30 */
28339  wl_cps_51zqendz ( 100 ) ; /* 30 */
28340  }
28341 /**************************************************************************************/
28342 /**************************************************************************************/
28343 /* Section: Interface Functions */
28344 /**************************************************************************************/
28345 /**************************************************************************************/
28346 /*!*************************************************************************************
28347  Function:
28348  static void init_WL_CPS(void)
28349  Summary:
28350  This function initializes the wire-line communications power supply (WL_CPS).
28351  Remarks:
28352  Refer to the wl_cps.h interface header for function usage details.
28353  */
28354 
28355 static void
28356  Init_WL_CPS ( void )
28357  {
28358  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 4))); /* 37 */
28359  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* Turn WL_CPS off.*/
28360  WL_CPS.new_voltage_flag = false ;/* Initialize the new voltage available flag as false.*/
28361  WL_CPS.new_current_flag = false ;/* Initialize the new current available flag as false.*/
28362  WL_CPS.max_current = 0U ;/* Initialize the max current seen to zero.*/
28363  WL_CPS.upper_current_limit = 200U ;/* 200mA max for W/L_CPS cutoff.*/
28364  WL_CPS.current_limit = 200U ;/* Initialize the current limit to 200mA.*/
28366  ( 3.3 /
28367  4096.0 ) * 20.0 ) ; /* Constant to convert ADC counts into VDC. 20.095 accommodates circuit attenuation.*/
28369  (
28370  ( 3.3 /
28371  4096.0 ) /
28372  ( 0.51 * 5.0 ) ) * 1000.0 ) ; /* Constant to ADC count into mA current. (0.51*5) accommodates sense resistor times gain.*/
28373  WL_CPS.spi_cont_pot = (
28374  (
28375  ( DRV_HANDLE ) - 1 ) ) ; /* Set to invalid to show SPI port is not open.*/
28376  WL_CPS.over_current_count = 0U ;/* Number of times current exceeded limit.*/
28377  WL_CPS.spi_write_complete_flag = false ;/* Initialize the SPI write complete flag.*/
28378  WL_CPS.spi_sent_flag = false ;/* Initialize flag to show we sent data to the SPI port.*/
28379  WL_CPS.voltage_limit = 70 ;/* 70V for W/L_CPS cutoff.*/
28380  WL_CPS.avg_count = 0U ;/* Initialize the current array counter.*/
28381  WL_CPS.avg_count_max = 5 ;/* Set the number of current readings for array.*/
28382  ( void ) memset ( WL_CPS.current_array , 0 , WL_CPS.avg_count_max ) ;/* Initialize the current array values to zero.*/
28383  WL_CPS.avg_current = 0U ;/* Initialize the average current result.*/
28384  WL_CPS.overvoltage_count = 0U ;/* Initialize the overvoltage count.*/
28385  ((int)(bitmapstruct.element3 |= (1 << 5))); /* 30 */
28386  wl_cps_51zqendz ( 102 ) ; /* 30 */
28387  }
28388 /*!*************************************************************************************
28389  Function:
28390  Read_WL_CPS_V_I(void)
28391  Summary:
28392  This task reads the current and voltage A/D. It stores the max current value.
28393  Remarks:
28394  Refer to the wl_cps.h interface header for function usage details.
28395  */
28396 
28397 static void
28399  {
28400  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 6))); /* 37 */
28401  uint8_t
28402  count ; /* counter to create average current.*/
28403  if
28404  (
28405  WL_CPS.new_voltage_flag == true
28406  ) /* If new voltage value is available,*/
28407  {
28408  ((int)(bitmapstruct.element3 |= (1 << 7))); /* 1 */
28409  {
28410  /* LDRA_INSPECTED 96 S
28411 */ /* Result is cast to an integer.*/
28412  WL_CPS.voltage = ( uint16_t ) rint ( ADC.wl_cps_v * WL_CPS.volt_constant ) ;/* Convert ADC counts to a voltage.*/
28413  WL_CPS.new_voltage_flag = false ;/* Reset the new values available flag.*/
28414  }
28415  } else ((int)(bitmapstruct.element3 |= (1 << 8))); /* 4 */
28416  if
28417  (
28418  WL_CPS.new_current_flag == true
28419  ) /* If new current value is available,*/
28420  {
28421  ((int)(bitmapstruct.element3 |= (1 << 9))); /* 1 */
28422  {
28423  WL_CPS.new_current_flag = false ;
28424  /* Reset the new values available flag.*/
28425  /* LDRA_INSPECTED 96 S
28426 */ /* Result is cast to an integer.*/
28427  WL_CPS.current = ( uint16_t ) rint (
28429  /* Convert ADC counts to a mA current.*/
28430  /* LDRA_INSPECTED 130 D
28431 */ /* WL_CPS.current does not need to be checked.*/
28432  WL_CPS.current_array[ WL_CPS.avg_count ] = WL_CPS.current ;/* Place new current reading into array.*/
28433  WL_CPS.avg_current = 0U ;/* Reset the average current result.*/
28434  for
28435  (
28436  count = 0U
28437  ;
28438  ( /* 28 */
28440  ) /* 7 */
28441  ;
28442  ( /* 7 */
28443  count ++
28444  , ((int)(bitmapstruct.element3 |= (1 << 10))) /* 27b */
28445  , ((int)(bitmapstruct.element3 |= (1 << 11)))) /* 27e */
28446  ) /* Create the sum of the current readings.*/
28447  {
28448  { /* 32 */
28449  int QZZZ = ((int)(bitmapstruct.element3 |= (1 << 12))); /* 32 */
28451  ((int)(bitmapstruct.element3 |= (1 << 13))); /* 6 */
28452  }
28453  }
28454  ((int)(bitmapstruct.element3 |= (1 << 14))); /* 5 */
28456  WL_CPS.avg_count_max ; /* Calculate the average of the readings.*/
28457  WL_CPS.avg_count ++ ;/* Increment the array counter.*/
28458  if
28459  (
28461  ) /* If the counter has reached the end of the array,*/
28462  {
28463  ((int)(bitmapstruct.element3 |= (1 << 15))); /* 1 */
28464  {
28465  WL_CPS.avg_count = 0U ;/* reset the counter.*/
28466  }
28467  } else ((int)(bitmapstruct.element3 |= (1 << 16))); /* 4 */
28468  }
28469  } else ((int)(bitmapstruct.element3 |= (1 << 17))); /* 4 */
28470  if
28471  (
28473  ) /* Check for a maximum current reading.*/
28474  {
28475  ((int)(bitmapstruct.element3 |= (1 << 18))); /* 1 */
28476  {
28478  }
28479  } else ((int)(bitmapstruct.element3 |= (1 << 19))); /* 4 */
28480  ((int)(bitmapstruct.element3 |= (1 << 20))); /* 30 */
28481  wl_cps_51zqendz ( 117 ) ; /* 30 */
28482  }
28483 /*!*************************************************************************************
28484  Function:
28485  void Check_WL_CPS_Over_Current(void)
28486  Summary:
28487  Checks the WL_CPS current for an over current condition and turns the WL_CPS
28488  supply off if more than 5 readings in a row occur.
28489  Remarks:
28490  Refer to the wl_cps.h interface header for function usage details.
28491  */
28492 
28493 static void
28495  {
28496  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 21))); /* 37 */
28497  if
28498  (
28500  ) /* WL_CPS Current has exceeded current limit,*/
28501  {
28502  ((int)(bitmapstruct.element3 |= (1 << 22))); /* 1 */
28503  {
28504  WL_CPS.over_current_count ++ ;/* Increment occurrence count.*/
28505  if
28506  (
28508  ) /* If it exceeds limit 50 times in a row,*/
28509  {
28510  ((int)(bitmapstruct.element3 |= (1 << 23))); /* 1 */
28511  {
28512  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* turn the WL_CPS supply off.*/
28513  Set_Status ( 14 ) ;/* Set the status bit to indicate an OVER_CURRENT.*/
28515  }
28516  } else ((int)(bitmapstruct.element3 |= (1 << 24))); /* 4 */
28517  }
28518  ((int)(bitmapstruct.element3 |= (1 << 25))); /* 3 */
28519  }
28520  else
28521  {
28522  ((int)(bitmapstruct.element3 |= (1 << 26))); /* 2 */
28523  {
28524  WL_CPS.over_current_count = 0U ;/* Reset Count.*/
28525  }
28526  }
28527  ((int)(bitmapstruct.element3 |= (1 << 27))); /* 30 */
28528  wl_cps_51zqendz ( 124 ) ; /* 30 */
28529  }
28530 /*!*************************************************************************************
28531  Function:
28532  void Adjust_WL_CPS_Voltage(uint8_t target)
28533  Summary:
28534  Adjust the WL_CPS to the desired voltage.
28535  Remarks:
28536  Refer to the wl_cps.h interface header for function usage details.
28537  */
28538 
28539 void
28541  uint8_t target ) /* Target is the desired voltage.*/
28542  {
28543  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 28))); /* 37 */
28544 
28545  const int8_t
28546  Counts [] = { 0 , 4 , 14 , 23 , 30 , 38 , 44 , 50 , 55 , 59 , 64 , 68 , 71 , 74 , 77 , 80 , 83 , 85 , 88 , 90 , 92 , 94 , 96 , 98 , 100 , 101 , 103 , 104 , 106 , 107 , 108 , 110 , 111 , 112 , 113 , 114 , 115 , 116 , 117 , 118 , 119 ,
28547  120 , 121 , 122 , 123 , 123 , 124 , 125 , 126 , 127 } ;/* 50 settings for WL_CPS voltage output.*/
28548  uint8_t
28549  pot_value = target ;
28550 /* LDRA_INSPECTED 493 S
28551 */ /* Only non negative numbers will be passed to this.*/
28552 /* LDRA_INSPECTED 52 S
28553 */ /* No numeric overflow will occur.*/
28554  pot_value = (
28555 
28556  ( ( /* 67 */
28557 
28558  ( pot_value < 15U )
28559  ) ?(((int)(bitmapstruct.element3 |= (1 << 29))),
28560  ((int)(bitmapstruct.element3 |= (1 << 31))),
28561  ((int)(bitmapstruct.element4 |= (1 << 0))),
28562  1)
28563  :( ((int)(bitmapstruct.element3 |= (1 << 30))),
28564  0)) /* 66 */
28565  ?
28566  15U
28567  :
28568 
28569  ( ( /* 67 */
28570 
28571  ( pot_value > 64U )
28572  ) ?(((int)(bitmapstruct.element4 |= (1 << 1))),
28573  ((int)(bitmapstruct.element4 |= (1 << 3))),
28574  ((int)(bitmapstruct.element4 |= (1 << 4))),
28575  1)
28576  :( ((int)(bitmapstruct.element4 |= (1 << 2))),
28577  0)) /* 66 */
28578  ?
28579  64U
28580  :
28581  pot_value
28582 
28583  ) - 15U
28584  ; /* Ensure target is within usable range and correct for Counts table.*/
28585  WL_CPS.v_adj[ 0 ] = Counts[ pot_value ] ;/* The Counts table provides predetermined pot settings for desired voltages.*/
28586  WL_CPS.bufferHandle = DRV_SPI_BufferAddWrite2 ( WL_CPS.spi_cont_pot , & WL_CPS.v_adj ,/* Send the pot setting to the control pot.*/
28587  sizeof ( WL_CPS.v_adj ) ,
28588  SPI_2_EventHandler , NULL , & WL_CPS.bufferHandle2 ) ;
28589  ((int)(bitmapstruct.element4 |= (1 << 5))); /* 30 */
28590  wl_cps_51zqendz ( 134 ) ; /* 30 */
28591  }
28592 /*!*************************************************************************************
28593  Function:
28594  void Set_WL_CPS_CurrentLimit(uint16_t value)
28595  Summary:
28596  Sets the WL_CPS current limit.
28597  Remarks:
28598  Refer to the wl_cps.h interface header for function usage details.
28599  */
28600 
28601 void
28603  uint8_t value )
28604  {
28605  int izzqqzz=((int)(bitmapstruct.element4 |= (1 << 6))); /* 37 */
28606  if
28607  (
28608  value > WL_CPS.upper_current_limit
28609  ) /* If the desired current limit is greater than the*/
28610  {
28611  ((int)(bitmapstruct.element4 |= (1 << 7))); /* 1 */
28612  { /* upper current limit,*/
28613  WL_CPS.current_limit = WL_CPS.upper_current_limit ; /* set the current limit to the upper current limit.*/
28614  }
28615  ((int)(bitmapstruct.element4 |= (1 << 8))); /* 3 */
28616  }
28617  else /* Otherwise,*/
28618  {
28619  ((int)(bitmapstruct.element4 |= (1 << 9))); /* 2 */
28620  {
28621  WL_CPS.current_limit = value ; /* set the current limit to the desired value.*/
28622  }
28623  }
28624  ((int)(bitmapstruct.element4 |= (1 << 10))); /* 30 */
28625  wl_cps_51zqendz ( 139 ) ; /* 30 */
28626  }
28627 /***************************************************************************************
28628  End of File
28629  */
28630 #define qqqbranches 139
28631 #define QQQMAXMCDCSIZE 2
28632 /********************** LDRA_PORT INSTRUMENTATION **********************/
28633 
28634 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
28635 #define ldra_sscanf
28636  /* put in undefs to protect our parameter names from macros */
28637 #undef f
28638 #undef i
28639 #undef j
28640 #undef k
28641 #undef s
28642 #undef l
28643 #undef ii
28644 #undef some
28645 #undef none
28646 #undef from
28647 #undef a
28648 #undef b
28649 #undef iz
28650 #undef jz
28651 #undef qqnull_params
28652 #define qqnull_params void
28653  /* Conventional Instrumentation */
28654 #define qqzzidfield 1
28655  /* single file or fileid */
28656  /* these have an extra field for the fileid */
28657  static char qqqqone[] = "%6d\n"; /* single point */
28658  /* uncompressed data structures */
28659  /* uncompressed bitmap */
28660 #define QQQFIXEDSIZE
28661  static int qqqlast = 0;
28662  extern int qqupload_registered;
28663  extern int wl_cps_51zqqzqz(qqnull_params);
28664  extern int wl_cps_51zqqzqz1(qqnull_params);
28665  /* ----------------------------------------------------------------------* 200 *
28666  * Procedures
28667  * -----------------------------------------------------------------------------
28668  */
28669  /* ----------- zscanf ---------------------------------------------------* 201 *
28670  * Returns an integer extracted from a string
28671  * -----------------------------------------------------------------------------
28672  */
28673  static int wl_cps_51zscanf(char * qqscan_str)
28674  {
28675  int qqvalue;
28676  int qqisign;
28677  char * qqcptr;
28678  qqvalue = 0;
28679  qqisign = 1;
28680  qqcptr = qqscan_str;
28681  /* Skip spaces */
28682  while (qqcptr[0] == ' ')
28683  {
28684  qqcptr++;
28685  }
28686  /* Check for a leading ---
28687  */
28688  if (qqcptr[0] == '-')
28689  {
28690  qqisign = -1;
28691  qqcptr++;
28692  }
28693  /* Extract digits */
28694  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
28695  {
28696  qqvalue = 10 * qqvalue;
28697  qqvalue = qqvalue + (qqcptr[0] - '0');
28698  qqcptr++;
28699  }
28700  qqvalue = qqisign * qqvalue;
28701  return qqvalue;
28702  } /* end of zscanf */
28703  /* ----------------------------------------------------------------------* 210 *
28704  * C System utilities in use:
28705  * fprintf
28706  * fclose
28707  * sscanf
28708  * -----------------------------------------------------------------------------
28709  */
28710  /* ----------------------------------------------------------------------* 213 *
28711  * qqoutput* suite
28712  * Main output routines. These may require modification.
28713  * -----------------------------------------------------------------------------
28714  */
28715  /* ----------------------------------------------------------------------* 214 *
28716  * qqoutput
28717  * This is the principle output routine.
28718  * -----------------------------------------------------------------------------
28719  */
28720  static void qqoutput(FILEPOINT char * s,int i)
28721  /* f - file pointer, s - format string, i - integer for probe value */
28722  {
28723  /* printing to a file */
28724  /* fprintf exists, not threaded */
28725  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
28726  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
28727  ldra_port_write (&ldra_buffer[0]);
28728  } /* end of qqoutput */
28729  /* ----------------------------------------------------------------------* 215 *
28730  * qqoutput0
28731  * -----------------------------------------------------------------------------
28732  */
28733  static void qqoutput0(FILEPOINT char * s)
28734  {
28735  ldra_port_write(s);
28736  } /* end of qqoutput0 */
28737  /* ----------------------------------------------------------------------* 216 *
28738  * qqoutput2
28739  * -----------------------------------------------------------------------------
28740  */
28741  static void qqoutput2(FILEPOINT char * s,int i, int j)
28742  {
28743  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
28744  ldra_port_write (&ldra_buffer[0]);
28745  } /* end of qqoutput2 */
28746  /* ----------------------------------------------------------------------* 217 *
28747  * qqoutput3
28748  * -----------------------------------------------------------------------------
28749  */
28750  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
28751  {
28752  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
28753  ldra_port_write (&ldra_buffer[0]);
28754  } /* end of qqoutput3 */
28755  /* ----------------------------------------------------------------------* 218 *
28756  * qqoutput4
28757  * -----------------------------------------------------------------------------
28758  */
28759  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
28760  {
28761  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
28762  ldra_port_write (&ldra_buffer[0]);
28763  } /* end of qqoutput4 */
28764  /* ----------------------------------------------------------------------* 219 *
28765  * end of qqoutput* suite
28766  * -----------------------------------------------------------------------------
28767  */
28768  /* ----------------------------------------------------------------------* 222 *
28769  * qqqqinitialise
28770  * This procedure initialises the structures for
28771  * compressed execution histories.
28772  * -----------------------------------------------------------------------------
28773  */
28774  static void qqqqinitialise(int ii)
28775  {
28776  unsigned int i;
28777  /* First time through. */
28778  /* bitmap */
28779  /* bitmap separate */
28780  qqqlast = 1; /* stops qqfun() calling initialise again */
28781  /* bitmap */
28782  /* bitmap singlefile */
28783  /* struct singlefile notmainfl */
28784  } /* end of qqqqinitialise */
28785 /* ----------------------------------------------------------------------* 225 *
28786 * qqqbitmapreset
28787 * This procedure resets the structures for
28788 * compressed execution histories.
28789 * -----------------------------------------------------------------------------
28790 */
28791 static void qqqbitmapreset()
28792 {
28793 struct bitmapstruct_t localbitmap = {0};
28794 bitmapstruct = localbitmap;
28795 } /* end of qqqbitmapreset */
28796 #undef QQQTEMP1
28797 #define QQQTEMP1
28798  /* ----------- zqqzqz ---------------------------------------------------* 310 *
28799  * -----------------------------------------------------------------------------
28800  */
28801  /* ----------------------------------------------------------------------* 312 *
28802  * This routine opens the execution history file. It is instrumented at the
28803  * start of the main program if one exists in the file. In general this is
28804  * superceded by wl_cps_51zqqzqz1 below.
28805  * -----------------------------------------------------------------------------
28806  */
28808  {
28809  if ( wl_cps_51zzopen != 1 )
28810  {
28811 #undef QQQMUSTOPEN
28812  wl_cps_51zzopen = 1;
28813  }
28814  return(1);
28815  } /* end of zqqzqz */
28816  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
28817  * -----------------------------------------------------------------------------
28818  */
28819  /* ----------------------------------------------------------------------* 317 *
28820  * This routine also opens the execution history file. It is called
28821  * automatically if a probe fires and the execution history is not already
28822  * opened (wl_cps_51zzopen = 0 ).
28823  * Because this always works ( it was intended for files with no main program
28824  * it is now the de facto common way to open the execution history.
28825  * -----------------------------------------------------------------------------
28826  */
28828  {
28829  if ( wl_cps_51zzopen != 1 )
28830  {
28831  ldra_port_open(); /* 7 */
28832  qqqqinitialise(0);
28833  wl_cps_51zzopen = 1;
28834  }
28835  return(1);
28836  } /* end of zqqzqz1 */
28837  /* ----------- zqendz ---------------------------------------------------* 330 *
28838  * This routine is called on exiting a routine in a
28839  * module. It closes the execution history.
28840  * -----------------------------------------------------------------------------
28841  */
28842 static int wl_cps_51zqendz(int qqqi)
28843  {
28844  if (!qqqstructzzopen)
28845  {
28847  qqqstructzzopen = 1;
28848  }
28849  if ( wl_cps_51zzopen != 1 )
28850  {
28851  wl_cps_51zqqzqz1();
28852  }
28853  /* ----------------------------------------------------------------------* 331 *
28854  * this is the one which puts an integer into
28855  * the execution history file and returns unity.
28856  * The format of each field consists of six columns,
28857  * the number is right justified in this field.
28858  * -----------------------------------------------------------------------------
28859  */
28860  if ( wl_cps_51zzopen )
28861  {
28862  /* uncompressed */
28863  /* uncompressed unbuffered */
28864  /* uncompressed unbuffered bitmap */
28865  if ( qqqi > 0 )
28866  {
28867  }
28868  else
28869  {
28870  }
28871  }
28872  qqqlast = 0;
28873  return(1);
28874  } /* end of zqendz */
28875  /* ----------------------------------------------------------------------* 335 *
28876  * Output structure - qqbmsoutput
28877  * -----------------------------------------------------------------------------
28878  */
28879  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
28880  {
28881  static int branches_printed = 0;
28882  int b, last = 0;
28883  for(b=0;b<qqqqbmselwidth/8;b++)
28884  {
28885  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
28886  ldra_port_write (&ldra_buffer[0]);
28887  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
28888  ldra_port_write (&ldra_buffer[0]);
28889  last += 8;
28890  branches_printed += 8;
28891  if (branches_printed >= qqqbranches)
28892  {
28893  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
28894  break;
28895  }
28896  }
28897  }
28898  /* ----------------------------------------------------------------------* 336 *
28899  * qqqupload
28900  * This routine loops through the stored bitmap and
28901  * outputs it. It then uploads the stored mcdc.
28902  * -----------------------------------------------------------------------------
28903  */
28904  static void qqqupload(qqnull_params)
28905  {
28906  int i;
28907  /* uncompressed bitmap (!singlefile or mainfl) separate */
28908  {
28909  wl_cps_51zqqzqz1();
28910 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
28911 #define LASTELEMENT
28912 #include "wl_cps_51zbelem.def"
28913 #undef LASTELEMENT
28914 #undef ELEMENT
28915  }
28916  /* bitmap separate */
28917  qqqlast = 1; /* stops qqfun() calling initialise again */
28918  } /* end of qqqupload */
28919  /* ----------- zqzqzq ---------------------------------------------------* 342 *
28920  * -----------------------------------------------------------------------------
28921  */
28922  /* ----------------------------------------------------------------------* 344 *
28923  * This routine should be called before the program
28924  * terminates. It closes the execution history
28925  * -----------------------------------------------------------------------------
28926  */
28927  static int wl_cps_51zqzqzq(int qqqi)
28928  {
28929  if ( wl_cps_51zzopen != 1 )
28930  {
28931  wl_cps_51zqqzqz1();
28932  }
28933  /* not compressed */
28934  /* do nothing for bitmap*/
28935  /* upload the history */
28936  /* bitmap */
28937  /* uncompressed bitmap */
28938  wl_cps_51zqendz(qqqi);
28939  /* qqqupload closes the execution history file */
28940  return(1);
28941  } /* end of zqzqzq */
28942  /* the following routines should be left alone */
28943 /* END OF TESTBED INSTRUMENTATION */
28944 
void DRV_IC_Stop(DRV_HANDLE handle)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
bool DRV_TMR4_Start(void)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
void DRV_USART0_TasksTransmit(void)
DRV_SPI_BUFFER_TYPE
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
void DRV_TMR3_Initialize(void)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR2_StopInIdleDisable(void)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
SYS_DMA_SIDL
uint16_t max_current
Definition: inszt_app.c:28642
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
static struct bitmapstruct_t bitmapstruct
bool new_current_flag
Definition: inszt_app.c:28649
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
uint32_t DRV_TMR1_PeriodValueGet(void)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
uint16_t wl_cps_v
Definition: adc.h:86
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
void DRV_TMR1_StopInIdleDisable(void)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_USART_LINE_CONTROL_SET_RESULT
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
static void Init_WL_CPS(void)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
int8_t v_adj[1]
Definition: inszt_app.c:28638
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
uint32_t DRV_TMR3_PeriodValueGet(void)
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
int qqupload_registered
Definition: inszt_main.c:6760
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void DRV_TMR4_StopInIdleEnable(void)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
float float32_t
Definition: cf.h:50
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
bool DRV_IC0_BufferIsEmpty(void)
#define FILEPOINT
Definition: inszt_wl_cps.c:93
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
uint16_t wl_cps_i
Definition: adc.h:85
static void DRV_TMR0_Open(void)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t overvoltage_count
Definition: inszt_app.c:28656
static void Read_WL_CPS_V_I(void)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
static SYS_STATUS DRV_TMR3_Status(void)
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
static SYS_STATUS DRV_TMR2_Status(void)
uint16_t avg_current
Definition: inszt_app.c:28655
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR2_CounterValueGet(void)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
float float32_t
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
void DRV_TMR1_CounterValueSet(uint32_t value)
void DRV_TMR1_CounterClear(void)
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void DRV_TMR1_Stop(void)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
void DRV_TMR0_Stop(void)
uint8_t upper_current_limit
Definition: inszt_app.c:28644
void DRV_TMR3_CounterClear(void)
uintptr_t DRV_HANDLE
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
void DRV_TMR3_CounterValueSet(uint32_t value)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
static void DRV_TMR0_Close(void)
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
DRV_SPI_PROTOCOL_TYPE
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
#define wl_cps_51zzopen
Definition: inszt_wl_cps.c:78
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
static void qqqupload(qqnull_params)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
void DRV_TMR4_PeriodValueSet(uint32_t value)
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
void SYS_DMA_Resume(void)
void DRV_TMR3_PeriodValueSet(uint32_t value)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
void DRV_ADC0_Open(void)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
uint32_t DRV_IC0_Capture32BitDataRead(void)
void DRV_ADC_Start(void)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
DRV_USART_LINE_CONTROL
#define DRV_IC_Open(drvIndex, intent)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
void Set_Status(uint8_t bitposn)
DRV_TMR_OPERATION_MODE
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE bufferHandle
Definition: inszt_app.c:28636
static int qqqisinitialised
Definition: inszt_main.c:152
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
static void DRV_TMR3_DeInitialize(void)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
bool spi_write_complete_flag
Definition: inszt_app.c:28650
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
DRV_SPI_BUFFER_EVENT
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
#define qqqbranches
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t avg_count
Definition: inszt_app.c:28652
static void DRV_TMR2_Close(void)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
void DRV_TMR0_StopInIdleEnable(void)
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
uint32_t SYS_DMA_ChannelCRCGet(void)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
static SYS_STATUS DRV_TMR1_Status(void)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
#define QQQnumfil
Definition: inszt_wl_cps.c:52
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
bool DRV_TMR_Start(DRV_HANDLE handle)
void ADC_Tasks(void)
Definition: adc.c:75
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
static void DRV_TMR3_Open(void)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
DRV_SPI_TASK_MODE
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
void Prepare_Return_B(uint8_t byt [])
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
WL_CPS_STATES state
Definition: inszt_app.c:28634
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
void DRV_TMR2_CounterValueSet(uint32_t value)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
void DRV_TMR1_PeriodValueSet(uint32_t value)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
uint8_t current_limit
Definition: inszt_app.c:28643
WL_CPS_STATES
Definition: inszt_app.c:28620
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
static WL_CPS_STATES CP_STATES
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
void DRV_USART_Close(const DRV_HANDLE handle)
SYS_PORTS_PIN_DIRECTION
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
int QQQindicator
Definition: inszt_main.c:104
SYS_DMA_CRC_WRITE_ORDER
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
static void DRV_TMR4_DeInitialize(void)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
DRV_SPI_MODE
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
DRV_USART_HANDSHAKE
void DRV_TMR4_Stop(void)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
uint32_t baudRate
Definition: inszt_adc.c:26572
#define DRV_IC_Close(handle)
static void DRV_TMR4_Close(void)
void DRV_ADC0_Close(void)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
WL_CPS_STATES
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
void DRV_TMR2_Initialize(void)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_USART_BAUD_SET_RESULT
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
static int wl_cps_51zqendz(int qqqi)
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
uint32_t PORTS_DATA_TYPE
void DRV_IC0_Start(void)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void DRV_TMR0_DeInitialize(void)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
void PLIB_USART_Enable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
void DRV_TMR0_CounterClear(void)
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
void DRV_ADC1_Close(void)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
void DRV_USART0_TasksError(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
void SYS_DMA_Suspend(void)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
static int zzfileid
Definition: inszt_wl_cps.c:51
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
SYS_DMA_CHANNEL_CRC_MODE
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
DRV_USART_BUFFER_EVENT
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
static int wl_cps_51zqzqzq(int qqqi)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
static void DRV_TMR0_Tasks(void)
static void DRV_TMR2_Open(void)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
#define wl_cps_51zqqzqz1
Definition: inszt_wl_cps.c:80
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
DRV_HANDLE spi_cont_pot
Definition: inszt_app.c:28635
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
void DRV_TMR3_StopInIdleEnable(void)
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
DRV_IO_INTENT
Definition: inszt_adc.c:975
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void DRV_TMR0_CounterValueSet(uint32_t value)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
static void DRV_TMR1_DeInitialize(void)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
bool DRV_SPIn_ReceiverBufferIsFull(void)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
void DRV_ADC_Initialize(void)
void DRV_TMR4_CounterValueSet(uint32_t value)
static void DRV_TMR3_Tasks(void)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
uint32_t DRV_TMR4_CounterValueGet(void)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
void DRV_USART0_Close(void)
void WL_CPS_Tasks(void)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
DRV_ADC_MODULE_ID
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
#define qqnull_params
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
float32_t volt_constant
Definition: inszt_app.c:28646
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_SPI_Close(DRV_HANDLE handle)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
uint32_t DRV_TMR1_CounterValueGet(void)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
static void qqoutput0(FILEPOINT char *s)
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
void DRV_PMP0_ModeConfig(void)
void DRV_TMR4_StopInIdleDisable(void)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
static SYS_STATUS DRV_TMR0_Status(void)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
DRV_TMR_CLK_SOURCES
static char qqqqone[]
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint32_t DRV_TMR2_PeriodValueGet(void)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
SYS_DMA_DATA_WIDTH
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
DRV_CLIENT_STATUS
Definition: inszt_wl_cps.c:930
DRV_SPI_CLOCK_MODE
ADC_STATES
Definition: adc.h:55
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
uint16_t current
Definition: inszt_app.c:28641
SYS_DMA_ERROR
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
bool DRV_TMR2_Start(void)
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
bool DRV_SPIn_TransmitterBufferIsFull(void)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
void DRV_USART0_WriteByte(const uint8_t byte)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
static void DRV_TMR1_Tasks(void)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
uint32_t DRV_TMR0_PeriodValueGet(void)
void SYS_DEBUG_Print(const char *format,...)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
void Adjust_WL_CPS_Voltage(uint8_t target)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
APP_DATA APP
Definition: app.c:73
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void APP_Tasks(void)
Definition: app.c:130
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
void DRV_ADC_DeInitialize(void)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
uint32_t DRV_TMR0_CounterValueGet(void)
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
DRV_USART_OPERATION_MODE
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
static unsigned char qqqzzglobflag
Definition: inszt_wl_cps.c:168
void APP_Initialize(void)
Definition: app.c:93
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
void DRV_TMR2_PeriodValueSet(uint32_t value)
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
struct _DRV_SPI_INIT DRV_SPI_INIT
DRV_USART_ERROR
Definition: inszt_adc.c:15426
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR3_Stop(void)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
uint8_t queueSize
Definition: inszt_adc.c:26592
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
int qqqshell_upload
Definition: inszt_main.c:150
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
DRV_TMR_CLIENT_STATUS
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
void DRV_USART0_Deinitialize(void)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
static void qqqqinitialise(int ii)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
SYS_DMA_CHANNEL_CHAIN_PRIO
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
static void DRV_TMR4_Open(void)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
void(* ldra_void_function)()
Definition: inszt_wl_cps.c:116
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_ADC_Stop(void)
void DRV_TMR1_Initialize(void)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
static void DRV_TMR2_DeInitialize(void)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
uint32_t DRV_TMR4_PeriodValueGet(void)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint8_t avg_count_max
Definition: inszt_app.c:28653
ADC_DATA ADC
Definition: adc.c:53
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
uint8_t DRV_USART0_ReadByte(void)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
void DRV_USART0_TasksReceive(void)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
bool SYS_DMA_IsBusy(void)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
void DRV_IC0_Stop(void)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
static void DRV_TMR2_Tasks(void)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
void DRV_IC0_Initialize(void)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
static int qqqqbmselwidth
Definition: inszt_wl_cps.c:50
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
void DRV_TMR2_StopInIdleEnable(void)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
void DRV_TMR2_Stop(void)
static void DRV_TMR4_Tasks(void)
float32_t current_constant
Definition: inszt_app.c:28647
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
void DRV_TMR0_StopInIdleDisable(void)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
uint16_t PORTS_DATA_MASK
DRV_USART_INIT_FLAGS
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
uint16_t current_array[5]
Definition: inszt_app.c:28654
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void qqoutput2(FILEPOINT char *s, int i, int j)
static int wl_cps_51zscanf(char *qqscan_str)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
uint8_t DRV_PMP0_Read(void)
DRV_IO_INTENT
Definition: inszt_wl_cps.c:886
void Clear_Status(uint8_t bitposn)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_IO_BUFFER_TYPES
Definition: inszt_wl_cps.c:987
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
static int QQQfirstmcdc
Definition: inszt_wl_cps.c:77
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void DRV_TMR4_CounterClear(void)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void DRV_TMR3_StopInIdleDisable(void)
void Set_WL_CPS_CurrentLimit(uint8_t value)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
void DRV_PMP0_Write(uint8_t data)
static void Check_WL_CPS_Over_Current(void)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
static int tbrun_mode
Definition: inszt_wl_cps.c:98
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void DRV_TMR0_PeriodValueSet(uint32_t value)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static int qqqstructzzopen
Definition: inszt_wl_cps.c:138
static void DRV_TMR1_Open(void)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
uint16_t voltage_limit
Definition: inszt_app.c:28640
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
bool DRV_TMR0_Start(void)
uintptr_t DRV_USART_BUFFER_HANDLE
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_USART_CLIENT_STATUS
void SPI_2_EventHandler(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_USART0_TransmitBufferIsFull(void)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
SYSTEM_OBJECTS sysObj
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_SPI_BUFFER_HANDLE bufferHandle2
Definition: inszt_app.c:28637
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
static void DRV_TMR1_Close(void)
Definition: app.h:59
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
Definition: adc.h:78
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
static void qqoutput(FILEPOINT char *s, int i)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
SYS_ERROR_LEVEL
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
ADC_STATES
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
uint8_t count
Definition: inszt_man.c:29594
void DRV_TMR0_Initialize(void)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
bool spi_sent_flag
Definition: inszt_app.c:28651
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void DRV_PMP0_Initialize(void)
uint32_t DRV_TMR3_CounterValueGet(void)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
DRV_USART_ERROR
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
uint8_t over_current_count
Definition: inszt_app.c:28645
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
void SYS_PORTS_Initialize()
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
SYS_STATUS DRV_USART0_Status(void)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
WL_CPS_DATA WL_CPS
static void qqqbitmapreset(qqnull_params)
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uintptr_t DRV_SPI_BUFFER_HANDLE
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static SYS_STATUS DRV_TMR4_Status(void)
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
uint16_t voltage
Definition: inszt_app.c:28639
SYS_DMA_CHANNEL_OP_MODE
DRV_USART_TRANSFER_STATUS
void DRV_TMR_Stop(DRV_HANDLE handle)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
void DRV_TMR1_StopInIdleEnable(void)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
static int qqqlast
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
void PLIB_USART_Disable(USART_MODULE_ID index)
void DRV_TMR2_CounterClear(void)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
void SYS_DEBUG_Message(const char *message)
uint16_t DRV_IC0_Capture16BitDataRead(void)
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
void DRV_TMR4_Initialize(void)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
DRV_USART_BUFFER_RESULT
static int wl_cps_51zqqzqz(qqnull_params)
SYS_ERROR_LEVEL gblErrLvl
SYS_DMA_CHANNEL_IGNORE_MATCH
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
bool new_voltage_flag
Definition: inszt_app.c:28648
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_TMR1_Start(void)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
PORTS_PIN_INTERRUPT_TYPE
bool DRV_TMR3_Start(void)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
static void DRV_TMR3_Close(void)
void DRV_TMR_Close(DRV_HANDLE handle)
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void DRV_ADC1_Open(void)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)